3 ms·
For the sake of argument, use `forEach` if you want to introduce side effects. `map` and `reduce` are names with meaning, and passing impure functions to them i
by zdragnar 6y ago
For the sake of argument, use `forEach` if you want to introduce side effects. `map` and `reduce` are names with meaning, and passing impure functions to them is more confusing than passing some procedural function to `forEach` or using `for of`.
It is something of a nit-picky argument to be sure, but it is a good mental habit to have.
Edit: I think being strict with the semantic building blocks is a good mental habit, not necessarily making nit-picky arguments.
- the-smug-one 6y agoBeing disciplined is part of good engineering. To have clearly defined idioms is important, so I want to reinforce that this is not nit-picky. You can argue that anything is nit-picky, under the guise of subverting good engineering in exchange for getting to be lazy.