Load-Bearing
A piece of code, comment, test, or instruction is load-bearing when removing it would break something important, usually in a way that isn’t obvious from looking at it.
Understand This First
- Smell (Code Smell) — the companion diagnostic frame for code that looks wrong.
- Invariant — the formal side of what load-bearing code often enforces informally.
- Blast Radius — load-bearing predicts how far a wrong deletion reaches.
What It Is
The term comes from structural engineering. A load-bearing wall holds up the floors above it. You can’t tell it’s load-bearing by looking at the wallpaper. You find out when you knock it down and the ceiling comes with it.
In software, a line of code, a comment, a test assertion, a config value, or a sentence in a system prompt is load-bearing when removing or weakening it causes something important to fail, usually in a way that isn’t obvious from looking at the thing in isolation. The artifact carries weight beyond what it appears to carry.
There are two flavors worth naming. A piece is intentionally load-bearing when the author knew it was critical and, ideally, said so in a comment, a test, or a named invariant. It is accidentally load-bearing when its importance accrued over time: callers came to depend on a behavior the author never meant to guarantee, and now the dependency is real but undocumented. The accidental variety is where most of the damage lives.
There’s a specific micro-species worth its own name: the load-bearing printf. A debug print statement that looks like leftover instrumentation is actually masking a race condition. Its flush or I/O delay changes timing just enough that the bug doesn’t appear. Remove it and the test suite starts failing intermittently.
Why It Matters
Every engineer has this story. You delete a line that looks dead, and the next morning production wakes up with an angry on-call page. You rename a variable and the CI pipeline detonates a week later. You simplify a comment block and the legal team calls. Each time, the artifact’s importance was tacit, not stated.
Agents make this failure mode more common, not less. An agent reading a file has the full current state in its context, but none of the history, incident reports, or Slack threads that explain why a line exists. When it proposes a deletion, its reasoning is structural: I see no caller, no test asserting this, no comment explaining it. Simplification is safe. This is confident demolition of Chesterton’s Fence — G. K. Chesterton’s rule that you shouldn’t tear down a fence you find in a field until you know why someone put it there. The agent isn’t wrong because it’s dumb. It’s wrong because the relevant evidence lived outside the repository.
Naming the concept gives reviewers a specific, one-word question to ask every time an agent proposes a deletion: is this load-bearing? If the answer isn’t obvious, the deletion is risky. If the answer is “I don’t know,” the answer is effectively “yes, treat it as load-bearing until you find out.”
The concept also unifies neighbors the book already covers. Invariant is the formal statement of what load-bearing code often enforces informally. Coupling is where accidentally load-bearing dependencies live. Blast Radius is the size of the crater when the load-bearing thing collapses. Load-bearing is the observational lens that sits above all of them: this thing matters more than it looks like it matters.
How to Recognize It
You rarely recognize load-bearing code by looking at it. That’s the whole problem. You recognize it by asking specific questions:
- What breaks if I remove this? If you can’t answer cleanly after five minutes, treat it as potentially load-bearing.
- Who depends on the current behavior, explicitly or implicitly? Grep for call sites. Search the test suite for assertions that would need updating. Check version-control history for the line’s origin; a commit message like “fix weird bug” on a line marked for deletion is a loud signal.
- Is there a comment, test, or type that states the importance? If yes, the code is intentionally load-bearing and the answer is written down. If no, and something important still depends on it, you’re looking at accidental load-bearing.
- Did anyone mention this in an incident postmortem? Scar tissue is often the only record.
A useful tell: the reviewer’s gut says I don’t understand why this is here, but I’m reluctant to remove it. That feeling is load-bearing-detection firing. Trust it long enough to investigate before deleting.
How It Plays Out
A developer asks an agent to clean up a retry loop. The agent removes a comment that says “Don’t remove: handles the 502 during vendor X’s weekly deploy window.” The comment looked like leftover documentation. It was intentional load-bearing guidance to the next reader, including agents. Ten days later, vendor X deploys and the service takes an outage nobody can diagnose.
A team notices a time.sleep(0.1) in a worker loop. No comment, no obvious purpose. An agent proposes removing it in the name of latency. The sleep was a debugging hack from 2022 that turned out to be masking a race between two writers to the same queue. The test suite doesn’t catch the race because both writers run in the same process in tests. Production traffic triggers the race within hours.
A reviewer approves an agent’s pull request that removes a test assertion. The agent’s justification: “The behavior under test isn’t specified anywhere else in the suite, so the assertion appears redundant.” Correct observation, wrong conclusion. The assertion was the specification. Once it’s gone, the next refactor quietly relaxes the behavior and the bug ships.
An agent rewrites a system prompt and deletes the sentence “Always summarize the plan before executing.” The prompt reads more cleanly afterward. The agent also stops planning. Two weeks of degraded output later, someone diffs the prompt and finds the missing line.
The most dangerous load-bearing artifacts are the ones that don’t look like code: a config value whose default was chosen for a reason nobody remembers, a comment that warns against a specific refactor, a sentence in a system prompt, a magic number in a constants file. Agents simplify these first because they look like noise. Run the load-bearing check before every agent-proposed deletion in these categories.
Consequences
Naming the concept changes how you review. You stop asking is this code clean? and start asking is this code load-bearing? The questions point in different directions. Clean code can be load-bearing. Dirty code can be dead weight. The load-bearing lens gives you a named check for a specific failure mode: the silent regression introduced by removing something whose importance wasn’t visible.
The discipline has two failure modes worth naming. The first is under-application: you ship the deletion, the failure happens weeks later, nobody connects the dots. The second is over-application: you treat everything as potentially load-bearing and the codebase freezes. Neither is the right response. The right response is to investigate, not to preserve by default. Where you find intentional load-bearing, leave it and make the importance more legible: add a comment, a test, or a named invariant. Where you find accidental load-bearing, promote it to something enforceable and then the refactor is safe.
There’s also honest tension with YAGNI and KISS. YAGNI pushes toward removing anything not currently needed. KISS pushes toward the simplest design. Load-bearing pushes back: simpler isn’t better if you’ve removed a support beam. The three principles cooperate in practice. YAGNI and KISS tell you what to remove; load-bearing tells you how to check before you remove it.
Related Patterns
- Informs: Smell (Code Smell) — load-bearing is the complement of code smell. Smells are things that look wrong; load-bearing things are things that look irrelevant but aren’t.
- Informs: Smell (AI Smell) — removing a line the agent “saw no reason for” is a recurring AI smell. Load-bearing is the reviewer’s lens for catching it.
- Tension with: KISS — KISS pushes toward simplification; load-bearing is the counterweight that asks what the simplification costs.
- Tension with: YAGNI — YAGNI says drop what you don’t need now; load-bearing asks whether you actually know what you need.
- Related: Local Reasoning — load-bearing-ness is the failure of local reasoning. If you could reason locally, the importance would be visible locally.
- Refined by: Invariant — the cleanest fix for accidentally load-bearing code is to promote it into a named invariant.
- Related: Side Effect — the load-bearing printf is the canonical side-effect case.
- Related: Contract — things become accidentally load-bearing when callers rely on behavior outside the contract.
- Related: Coupling — hidden coupling is where accidental load-bearing lives.
- Related: Dependency — load-bearing relationships are often undeclared dependencies.
- Predicts: Blast Radius — how far breakage reaches when the load-bearing thing goes.
- Manifests as: Silent Failure — removing load-bearing code often produces failures that stay silent until pressure hits.
- Checked by: Code Review — load-bearing is the question a reviewer should ask on every deletion.
- Gated by: Approval Policy — load-bearing deletions are exactly the class of change that wants human approval.
- Checked before: Refactor — every refactor is a load-bearing check before it’s an edit.
Sources
- Jeff Kaufman’s short essay “Accidentally Load Bearing” (2023) is the informal canonical treatment. Kaufman named the specific pattern of an artifact accruing importance it was never meant to carry, and his framing is what most practitioners reach for when they use the term today.
- G. K. Chesterton’s 1929 essay “The Thing” contributed the upstream principle (“Don’t remove a fence until you know why it was put there”) that load-bearing later named from the other side. Where Chesterton’s Fence is the rule for reviewers, load-bearing is the noun for what the rule protects.
- The FOLDOC entry “load-bearing printf” records the micro-species: a debug print whose timing side-effect quietly masks a race condition. The term has lived in practitioner folklore since at least the early 2000s.
- Jason Gorman’s essay “Do You Know Where Your Load-Bearing Code Is?” (2023) applies the concept to team practice and review discipline, making the case that most codebases have load-bearing surfaces their owners cannot locate on a map.
- The agentic-coding framing, in which load-bearing becomes especially sharp because agents confidently remove things they don’t understand, emerged across the practitioner community in 2025–2026 as teams started shipping agent-generated deletions at scale and learning the failure mode by paying for it.
Further Reading
- Hacker News discussion on “Accidentally Load Bearing” — a long thread of practitioner anecdotes that shows the concept’s reach across language ecosystems.
- Martin Fowler’s bliki entry on “Contract Test” — the positive inversion of load-bearing: promote a tacit dependency into an explicit, executable contract so the next reader (human or agent) can see the weight.