Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

My OO...

Name: Anonymous 2011-12-13 3:19

...it's violated!

http://programmers.stackexchange.com/questions/17031/when-c-handles-pop-in-your-c-code-and-break-your-pretty-oo-design

Anime avatar. Passive-aggressive rant. Autismal as fuck. That's gotta be someone from /prague/, amirite?

Name: Anonymous 2011-12-15 21:38

>>66
Yes, there are special rules for "arithmetic promotion."
The distinction is useless (i.e. purely arbitrary) if you allow it for floats and not for pointers to char. This is why I'll tell anyone who says C isn't weakly typed they don't know C.

It's still misleading to call that dynamic typing, though.
It's not dynamic, it's static with an implicit conversion. Even C's explicit type conversions are not safe on the whole, esp. void.

Yeah, believe me, I fully understand how shitty C is.  Still, shitty does not necessarily imply weakly typed.
For one, I love C. There are a few things I wish were different but changes to the type system are very far down that list. I wouldn't call it shitty by any means. You've probably read those blog posts about "const poisoning" by Chicken Little—it's never difficult to resolve by those who actually write C without posting every challenge they encounter to their blog.

The 'strength' of the type system isn't a value judgment, it's a semantic one. The typing is weak because it's weakly enforced, in fact you won't get much weaker in a static language.

>>68
But more importantly, NO C compiler implicitly converts the string "Hello" into an integer.
#include <stdio.h>

int main(void) {
   printf("%d\n", 2 + "Hello");
   return 0;
}


You sure about that? Might want to check the assembly output.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List