
Bottom line. Add a line called Removed to every engineering status update and count deletions by team: net lines of code, services retired, feature flags removed, dependencies dropped, dashboards and alerts deleted, recurring meetings canceled. Code nobody removes keeps costing money. Knight Capital lost about $440 million in 45 minutes in 2012 when a reused flag switched on a function nobody had used since 2003. Protect the count from Goodhart’s Law by never ranking individuals and by reporting every deletion number next to rollbacks and incidents. You will come away with six counts, where each number comes from, and four rules that keep the metric from being gamed.
Engineering status reports count what got added: features shipped, tickets closed, services launched, roles filled. Almost none of them has a line for what the team removed that week.
The last of the six habits in Anyone Can Build the Complicated Version was to make deletion visible. On a real team, that means counting removals with the same care as launches, in the same report, every week, without letting the count turn into a target.
Minus Two Thousand
In early 1982 the Lisa team at Apple was pushing to finish its software, and managers started requiring a weekly form from every engineer. One field asked how many lines of code the engineer had written that week.
Bill Atkinson, who wrote QuickDraw, had spent that week rewriting its region calculation routines. The new version ran about six times faster and came out about 2,000 lines shorter. He wrote -2000 on the form. A couple of weeks later the managers stopped asking him to fill it out.
Six years later, in EWD1036, “On the Cruelty of Really Teaching Computing Science,” Edsger Dijkstra argued that anyone who insists on counting lines of code should count them as “lines spent”. The industry, he wrote, was booking them as output, on the wrong side of the ledger.
Power Peg
On August 1, 2012, Knight Capital lost about $440 million by its own account, and more than $460 million by the SEC’s, in roughly 45 minutes after the market opened. The SEC’s 2013 order traced the losses to a deployment error and to code nobody had deleted.
Knight’s order router, SMARS, still contained a function called Power Peg that had gone unused since 2003. In 2005 the team moved the counter that told Power Peg when an order was filled to a different part of the code, and never tested whether Power Peg still worked without it. The function stayed in the binary, switched off by a flag.
In 2012, developers building support for the NYSE’s new Retail Liquidity Program reused that flag. A technician deployed the new code to seven of Knight’s eight servers and missed the eighth. On that server the flag turned Power Peg back on, with nothing to tell it to stop. It worked through 212 parent orders and produced 4 million executions in 154 stocks, more than 397 million shares.
Before the open, Knight’s systems sent staff 97 automated emails mentioning Power Peg, and nobody treated them as an alarm. Getco acquired Knight the following year. Had Power Peg been deleted in 2005, the flag on the eighth server would have had nothing to switch on.
Google and Meta Count It
In April 2023, Phil Norman described Sensenmann on the Google Testing Blog. The name is German for the figure of Death. The system finds libraries no binary links to and programs nobody has run in a long time, then sends the owners a change that deletes them. It submits more than 1,000 deletion changes a week and had removed nearly 5 percent of Google’s C++. Google estimates it has paid for itself tens of times over in maintenance it no longer has to do.
Norman wrote that some engineers resist the automated changes, much as some resisted unit testing twenty years earlier, and that acceptance rises as the tool gets more accurate.
Meta built the Systematic Code and Asset Removal Framework, SCARF. A 2023 paper at the FSE conference reported that in one year it deleted more than 104 million lines of code and removed petabytes of data across 12.8 million assets. It commits code changes and drops database tables on its own, and asks engineers for input when it cannot act safely.
What to Count
A team does not need Sensenmann to start. Six counts cover most of what a team removes, and each one comes from a tool the team already runs.
Net lines of code. Lines added minus lines removed, per repository per quarter. Source: version control history.
Services retired. Services taken to zero traffic, with callers removed and cloud resources deleted. Source: the service catalog and the cloud bill.
Feature flags removed. Flags fully on or fully off for 30 days that got deleted from the code, plus the age of every flag still live. Source: your flag management tool.
Dependencies dropped. Third-party packages removed from manifests. Source: lockfiles.
Dashboards and alerts deleted. Dashboards with no views in 90 days and alerts nobody acted on. Source: observability tool usage logs.
Meetings cancelled. Recurring meetings ended, counted as hours per week returned to the team. Source: team calendars.
Goodhart Still Applies
Charles Goodhart made the observation about monetary policy in 1975. The version usually quoted comes from the anthropologist Marilyn Strathern: once a measure becomes a target, it stops measuring well. That is what happened to lines added at Apple in 1982. Put lines deleted on a performance review and the same thing happens: engineers hit the number by reformatting files, dropping tests or removing a module somebody still needed.
Four rules keep the count useful.
- Count by team, never by person. A per-person count rewards splitting one cleanup into ten pull requests.
- Weight removals by what they cost to keep. A retired service with a monthly bill and an on-call rotation counts for more than a deleted comment block.
- Pair every deletion count with a guard metric. Track rollbacks, incidents, and restored code within 30 days of a removal, in the same report.
- Document why each deletion is safe. G. K. Chesterton argued in The Thing, in 1929, that a reformer should not tear down a fence until he knows why somebody put it up. Each deletion pull request names what the code did and how the team knows nothing calls it.
One Line in Next Week’s Update
Add a line called Removed to next week’s status update. Under it, list each item with its size: a deleted flag, an archived repository, a standup that met three times a week and now meets once. Leave the line in on weeks when it says none.
Reader discussion