4 ms·
I find that pure functional loops with reduce or fold often get a lot harder to read/write as soon as you have more than one variable to keep track of. Imperati
by jcparkyn 3y ago
I find that pure functional loops with reduce or fold often get a lot harder to read/write as soon as you have more than one variable to keep track of. Imperative loops don't really have this problem.
- throwawaymaths 3y agoFor me it's the other way around. With reduce you have to explicitly declare what you're keeping between each iteration. When you have an imperative loop the state of any of the variables youve declared is up in the air. It gets even worse if you've shadowed variable names.