Process5 min read
The hundred-line rule
One rewrite, 141 files, and the largest of them exactly a hundred lines. The rule is not about tidiness. It is about what a ceiling forces you to decide early.
The ceiling, not the average
Averages lie. A codebase whose files average forty lines can still hold the one eight-hundred-line component that every change has to go through, and that file is the codebase as far as your afternoon is concerned.
A ceiling does not lie. In the rewrite that made me keep the rule, there are 141 files and the largest is exactly a hundred lines. Not close to a hundred. Exactly, because that is where the rule made me stop and split rather than let it slide to a hundred and six.
What a ceiling does to a rewrite
The ceiling turns a vague instinct into a moment with a timestamp. At line ninety you are not admiring your architecture, you are deciding what this file is actually about, and the answer is usually that it is about two things.
A file you can read in one screen is a file you will actually read before you change it. That is the whole argument.
The fullpage engine as a case in point
The site it came from used a fullpage scrolling library. I replaced it with our own engine, and the ceiling is the reason it stayed readable: state lives in a data attribute on the wrapper, slides move on a transform, and a slide is only allowed to switch once its own inner content has been scrolled to the edge.
That last rule is the one users feel, and it fits in a handful of lines because everything around it had already been split out. Twelve per-screen animation modules replaced a single placeholder that had made every screen enter identically, and the images went from 2.8 MB to roughly half a megabyte on the way past.
Where it hurts
It hurts in three places, and pretending otherwise would be dishonest. Generated files and icons do not obey it, so the rule needs written exceptions. Some logic is genuinely one long sequence, and cutting it into three files makes it worse, not better. And a file count rises, so the import graph has to be conventional or you trade one kind of confusion for another.
What I would keep
Keep the ceiling, write down the exceptions, and never enforce it with a formatter that splits a function in half to satisfy a number. The rule is a prompt to make a decision, not a metric to optimise.