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 16:37

>>16
The example, a parameter-less functions modifying what looks like a local variable, isn't your average error out of carelessness. In fact, you'd need to take serious effort in order to get this running in the first place. All this software written by the brainless may be bad, but it isn't that bad. It can't be that bad because a brainless one wouldn't do the amount of pointer magic necessary for this scenario. >>1-san's scenario is about as synthetic as it gets.

I'd love to see how you'd solve this specific problem with aliasing semantics, but in total, I'm convinced that Dijkstra was right: Basic mathematics (think on level of Calc I) should be a requirement for programming, if only to keep the toilet scrubbers out.

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