3 ms·
Yes, instead of writing a custom for-loop use map/filter/reduce. Also make other things like this that fit either under computer-programming or domain knowledge
by karmakaze 5y ago
Yes, instead of writing a custom for-loop use map/filter/reduce. Also make other things like this that fit either under computer-programming or domain knowledge. The interface/contract/behaviour of these 'known' parts can usually be made clear without unexpected side-effects. From then on, treat them as black-boxes.
It's rare that I find mental capacity to be the limiting factor, rather than the unintentional obfuscation of the implementation. Perhaps this is just to say that the code itself is a source of incidental (aka accidental) complexity or confusion.