Sandi Metz's 2016 rule: duplication is cheaper than the wrong abstraction
A developer pulls repeated code into a shared function. The next requirement almost fits, so they add a parameter. Then a flag. Then a conditional. Ten years on, the essay describing that slide is back, and the fix it prescribes is to walk it back: re-inline, delete, re-derive.
The trap is a sunk-cost spiral. Each near-miss requirement gets bolted onto the abstraction rather than rejected, until the code is a tangle of booleans nobody can reason about. Her slogan: "the fastest way forward is back." Inline it into every caller, prune dead branches, rebuild.
The thread split on whether this survives real teams. One camp says it gets weaponized to bless permanent slop; another calls the framing a category error. And when a model maintains the copies, sameness that drifts silently becomes its own hazard.
The lifecycle that ends in a tangle of flags
A 2016 essay climbing the front page in 2026 usually earns it on durability, and Sandi Metz's piece has the kind of line people quote from memory: "duplication is far cheaper than the wrong abstraction."
The lifecycle she lays out is precise. A developer sees repeated code and extracts it into a shared abstraction. A new requirement arrives that almost — but not quite — fits. Rather than abandon the abstraction, the next developer passes a parameter, then adds a conditional, then another. Repeat until the code is an incomprehensible thicket of branches whose valid combinations nobody can enumerate.
Why nobody backs out
A sunk-cost reflex keeps the wreck standing: the abstraction already exists, so each developer feels obliged to honor it instead of deleting it. Metz's prescription cuts the other way. Re-inline the abstraction back into every caller. Delete the now-dead branches caller by caller. Then re-derive cleaner abstractions from what the requirements actually are today. "The fastest way forward is back." The argument drew 433 points and 300 comments, and the thread supplied the half the blog post leaves implicit.
The half the post leaves out
The most useful addition came from someone who had seen Metz deliver it live.
"I watched a talk by her about this, and this post is missing half of the equation… Having a wrong abstraction means you end up with a class/function/module with a huge amount of configurations through boolean/enum parameters." — a commenter who watched Metz's talk on this
The skeptics' worry was about how the slogan gets used once it leaves the talk.
"I've literally never seen teams duplicate code responsibly and later dedupe it when it's the right time." — an engineer describing his own teams' practice
A sharper objection rejected the binary outright.
"If it's duplication, it's the same abstraction by definition. The fundamental unit of programming is intent, not code." — a developer who links his own github.com/dmos62
And the rule met a failure mode that did not exist in 2016, raised by a reader thinking about who edits the copies now.
"…code generated and duplicated without proper abstraction and then maintained by an LLM that cannot be trusted to do the same modification each time it encounters a pattern" — a commenter weighing the cost of duplication at customer scale
The rule has an edit for the model era
The principle holds, but its safety margin has shrunk. Metz assumed a human would eventually walk the duplication back; the thread's hard cases — teams that never dedupe, and models that silently apply a pattern inconsistently across copies — both attack that assumption. The honest restatement is narrower: duplication is cheaper than the wrong abstraction only when someone can be trusted to make the same change in every copy. When that someone is a model that drifts pattern to pattern, the cheap option quietly stops being cheap.
Get breakdowns like this every day
The top Hacker News stories, unpacked — by email, Telegram, or RSS.
Switzerland's Apertus is fully open down to the data — and has no GPUs
EPFL, ETH Zurich and the national supercomputing center shipped a foundation model where the training data, code, weights and alignment are all published. The unusual part: the license warns its output may contain personal data, and ships you a hash file of deletion requests to filter it yourself.