4 ms·
Maybe the solution is to break the large function into several smaller ones, even if they still make use of for loops.
by visarga 11y ago
Maybe the solution is to break the large function into several smaller ones, even if they still make use of for loops.
- michaelfeathers 11y agoNo doubt. But once it gets to a certain point the costs of doing that are much larger than having started in a compositional style. If you have Martin Fowler's Refactoring book, check out the intro example. It's a 20 line function and the amount of refactoring work he does on it to make it sensible is quite large.