3 ms·
1. Functions which are "longer than they should be" decrease code quality. 2. Measuring the "number of lines per function" is extremely easy. Code quality too
by mnarayan01 9y ago
1. Functions which are "longer than they should be" decrease code quality.
2. Measuring the "number of lines per function" is extremely easy.
Code quality tools have a bad tendency to equate (1) and (2) for the same reason that the proverbial drunk searches for his keys under the streetlight. This has legitimately bad consequences.
This is further compounded by the way that small functions ease mock-based testing. While certainly attractive in the abstract, when a code base is overly influenced by this I find that it is substantially more difficult to understand via inspection.
All that said...I find the whole "X considered harmful" formulation almost unbelievably annoying. Here it doesn't even make any sense.