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 18:40

>>25
It is that bad. Sometimes its a typo, sometimes its something analogous to >>1's code, but less obvious: for(whatever) { array[next_location()] = foo(); } Even >>1's code happens. Global state is very common in C, look at any non-threadsafe library.

Good aliasing rules simply makes it impossible to compile the code in >>1. Having multiple references to mutable state is wrong.

Dijkstra wasn't wrong, but that kind of math doesn't help with this. You need another kind of math, the kind that makes you wonder what advantage people see in languages with such shortcomings.

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