4 ms·
A surprising one is to avoid all kind of jumps (early return, breaks and continues). A broader one: writing expressions as much as possible. Basically, it mean
by newzombie 7y ago
A surprising one is to avoid all kind of jumps (early return, breaks and continues).
A broader one: writing expressions as much as possible. Basically, it means avoiding unnecessary mutations (and jumps).
Then avoiding architecture. Thinking algorithms that process data (instead of "systems") has been transformative.
- mekster 7y agoWhy avoid early returns? If something doesn't match a condition to process anything in the function, then it's cognitively better to return early and say that case should be left out before possibly doing anything weird in it.