|
|
|
|
|
by shivawu
539 days ago
|
|
I agree except I think 100 lines is definitely worth a method, whereas 15 lines is obviously not worthy for the most cases and yet we do that a lot. My principle has always been: “is this part a isolated and intuitive subroutine that I can clearly name and when other people see it they’ll get it at first glance without pausing to think what this does (not to mention reading through the implemention)”. I’m surprised this has not been a common wisdom from many others. |
|
Good abstractions often reduce LOC, but I prefer to think of that as a happy byproduct rather than the goal.