2 ms·
It's more readable to the CPU too. Deeply nested code, especially with many functions that are called once, is really horrible to debug. Extract functions whe
by userbinator 3y ago
It's more readable to the CPU too.
Deeply nested code, especially with many functions that are called once, is really horrible to debug.
Extract functions when you see obvious repetition, not just to appease some dogmatic abstraction goal. Incidentally, this also helps the CPU (cache locality).
Along the same lines, I'd rather have a directory with several dozen source files than several dozen nested directories that may contain only one or two files each.
- realrains 3y agoI don't think the issue is about which code is more readable, but whether it's efficient for the CPU or the computer. Modern compilers optimize more than we think in production builds.