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

Evaluation Order Sucks

Name: Anonymous 2014-07-14 0:56

Just fixed an error with
array[count++]= foo();
where foo() modified count, in effect writing stuff into the incorrect location.

Haskell's lazy evaluation would have prevented that.

Name: Anonymous 2014-07-14 23:37

>>28
Global state is very common in C, look at any non-threadsafe library.

Global state is also trivially avoidable in C, and any decent library avoids it. The fact that things like the C standard library have global state isn't evidence that global state is OK; if anything all the effort that has gone into standardizing thread safe alternatives to old stdlib functions demonstrates the exact opposite.

Having multiple references to mutable state is wrong.

Maybe so, but C does nothing to enforce this. Not having anything in the global scope makes it that much harder for it to happen by mistake.

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