3 ms·
I don't know if this counts as irony, but here goes: The killer feature of programming with pure functions is that you can guarantee the same output for the sa
by mrkeen 6y ago
I don't know if this counts as irony, but here goes:
The killer feature of programming with pure functions is that you can guarantee the same output for the same input. If I were pushing this idea 5+ years ago, I would have said "Unfortunately you have to give up your comfortable for-loops and mutable variables* and learn about these weird maps and folds instead, but it's well worth the trade!"
Fast-forward a few years and now maps and folds are everywhere in the mainstream (it's even recommended to use them over for-loops in many cases.) But we never got the same-input-same-output guarantee which was my reason for switching in the first place!
* Even that's being too pessimistic. You can have your mutable cake and keep your guarantees, too: https://wiki.haskell.org/Monad/ST#A_few_simple_examples https://wiki.haskell.org/Monad/ST#A_few_simple_examples