3 ms·
> I find it easier to keep in my head when methods are short. How short? 100 lines? 10 lines? 1 line? "It depends" => i.e. discuss forever in PRs towards a one
by rdsubhas 8y ago
> I find it easier to keep in my head when methods are short.
How short? 100 lines? 10 lines? 1 line? "It depends" => i.e. discuss forever in PRs towards a one-way "shorter and shorter" ticket?
More and more coders who join the project say the same thing, and reduce methods shorter and shorter and shorter, until it's dozens of classes with one method each having small lines like "twiddle-doo" and "fiddle-foo". Of course, now the method is easy to memorize, and supposedly it's "clean code" now. But the functional value and flow is just completely screwed up and can never fit in the head of anyone.
- nerdponx 8y agoI should clarify - I wouldn't accept a PR just to shorten a method for its own sake, if it's already written and working.