2 ms·
> For readability and conciseness you would most likely use a fold instead. Agree strongly with this. Long complex for-loops in imperative languages that are m
by seanwilson 9y ago
> For readability and conciseness you would most likely use a fold instead.
Agree strongly with this. Long complex for-loops in imperative languages that are mutating a counter along the way, building up a list along the way, have "if (...) { continue; })" parts, have nested loops etc. make me cringe now.
Break your code up into a series of folds, maps and filters and it's miles more readable. I find a lot of imperative programmers just don't think in this way and mangle folds, maps and filters into one big confusing ball.