How big should a method be?

Cognitive load should be the metric, not size

Kislay Verma

--

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…

--

--