2 ms·
What is for loop fatigue? Seems like a fake problem that one would only feel if they buy too much into functional programming. Some ideas in fuctional program
by hsn915 4y ago
What is for loop fatigue?
Seems like a fake problem that one would only feel if they buy too much into functional programming.
Some ideas in fuctional programming are useful, but overall, for loops are much more preferable to map/filter/reduce.
For loops are much more easily amenable to incremental changes.
"reduce" is particularly bad. It obfuscates control flow for no benefit at all.
- RhodesianHunter 4y ago>but overall, for loops are much more preferable to map/filter/reduce I strongly disagree on this one. A .map or a .filter are clear and concise while filtering or mapping, particularly in a streaming situation where you're only iterating the collection once. You can trivially write code using this paradigm that's easily readable, performant, and takes up a handful of lines that would take dozens in Go.