top | item 45477028

(no title)

lblume | 4 months ago

Reduce can be very useful to signal that the state used is inherently limited. My rule of thumb is to use reduce when the state is a primitive or composed of at most two primitives, and a for loop otherwise. What counts as "primitive" depends on the language of choice and abstraction level of the program, of course.

discuss

order

Quekid5|4 months ago

Fair observation, but just opening a local lexical scope (in an expression-oriented language) can help with that. Also ... something something ST monad :)