4 ms·
I used to believe that, but after a while I realized that it's a heuristic derived from code that's already split up into clear responsibilities. Large methods
by danneu 14y ago
I used to believe that, but after a while I realized that it's a heuristic derived from code that's already split up into clear responsibilities.
Large methods are only a symptom that this component of your system does too much and probably has too many dependencies. Small methods do nothing for you except add indirection if you've not solved the dependency problem, and adding indirection to an entangled system is even worse than having large methods.
In other words, somehow an aspect of the end result of clear code became common advice, probably because it's so obvious and replicable. "Write decoupled code with focused responsibilities" on the other hand is nebulous.
It's sort of like when dating advice is simplified into "be mean to girls".