2 ms·
> It also gets really ugly when foo, bar, and baz are instead line-long expressions, which they often are I sometimes use variables to "take a breather". You
by davidw 18y ago
> It also gets really ugly when foo, bar, and baz are instead line-long expressions, which they often are
I sometimes use variables to "take a breather". You do some heavy, syntax and/or meaning laden work, and put the result of all of it in 'current_velocity' or whatever, and that conceptually helps you to move on to the next thing with the result of what you've just done firmly in mind. Single assignment doesn't prevent that, obviously, but sometimes functional code uses them less and just uses a bunch of nested functions. Those Haskell examples you posted seem like a nice idea, by the way.
http://journal.dedasys.com/articles/2007/01/17/clockwork-languages http://journal.dedasys.com/articles/2007/01/17/clockwork-lan...