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 19:21

>>52
That table is nonsense and seems to be built on the idea that weak typing precludes static typing. Not only is C weakly typed, it behaves differently than stated:

concatenate(a, b) # not a type error, probably a segfault
add(a, b)         # not even wrong, just semantically different


You can even change "2" to 2.0, and it moves from the right column to the left column.

Name: Anonymous 2011-12-15 20:03

>>58
You can even change "2" to 2.0, and it moves from the right column to the left column.
NO!  This is 100% completely false, and your misunderstanding is apparently common to nearly every poster in this thread.

If you take the example on the right side of the table as C, then it would have to look like this:


int a = 2;
char *b = "2";
 
concatenate(a, b);
add(a, b);


See that?  Variables are declared with a static type.  Changing the first line to this:


int a = 2.0;


does not change a to type float.

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