How big should a method be?
Cognitive load should be the metric, not size
4 min readMay 29, 2021
--
Let’s say there’s a method in the codebase that does 4–5 things one after the other. The code for doing all those things is well-written, but the result is a somewhat large method. At what point should you break it up into multiple methods? There is the old adage about every method being fully visible without scrolling which I have always…