3 ms·
I’m fanatical about functional programming, and I would never choose this example to demonstrate why I am. The imperative code doesn’t demonstrate any kind of p
by eyelidlessness 4y ago
I’m fanatical about functional programming, and I would never choose this example to demonstrate why I am. The imperative code doesn’t demonstrate any kind of problem (see Rich Hickey’s explanation of transient types), and the functional code demonstrates how but not why. I’d certainly use a modified version of this example where the inputs might be mutated by other parts of a program. But without that, this is just philosophical navel gazing pretending to explain how to solve mysterious problems.