2 ms·
Or, to understand this one level deeper: Functions/methods should do one thing, and do that one thing well. In general, each of those one things should be small
by kstenerud 7y ago
Or, to understand this one level deeper: Functions/methods should do one thing, and do that one thing well. In general, each of those one things should be smallish things that you use to compose bigger things, which also do one thing and do it well.
24 lines is as good a rule of thumb as any, as long as you're not actually counting the lines. Your goal is flow and readability (ultimately: maintainability), not some countable metric.