What went wrong when line count was the goal
We set out to make the app’s code far less than half its size. Working toward that number made it harder to tell the code to cut from the features to keep.
Even after fixing the structure several times, the app was still big. So we set out to cut about 145,000 lines, not counting blank lines and comments, down to 50,000. We split the app into areas and rebuilt it in a single night. The result was about 124,000 lines, and the app couldn't be built, so we reverted.
At first, cutting less looks like failure. But first we should look at what we rebuilt from. We used the old code as the spec. Keeping every rule we drew from it left almost nothing to cut. The old code mixes rules the product needs with rules that exist only because of the old structure. Move it as is, and both come along.
When line count becomes the goal
The next target was 70,000 lines. This time we could reach it only by dropping features. Cut further and the number would look better, but it would no longer be the app people used. So we dropped the target. With all features kept, we agreed to accept up to 77,000 to 78,000 lines.
When we compared the new code with the original, 67 features turned up missing because nobody owned them. 49 were missing entirely and 18 were partly missing. We ran 13,219 saved scenes on the old code and the new, and midway through the rewrite 13,217 of them gave the same result. But that nearly all the scenes match and that every feature is there are separate facts. A feature that isn't in the scenes doesn't show up as different.
The app with the areas merged is 84,169 lines. Starting several jobs at once from an empty state also led to small functions that do the same thing being built several times. From now on we look at line count but don't make it the goal. The first thing to ask isn't how many lines we cut but what's no longer needed.
Written from that day’s point of view, using the documents and change history of the time. Published 2026.12.01.
