Book Deep-Read · Software Engineering at Google · Chapter 15
Software Engineering at Google · Ch 15 · Deprecation · Hyrum Wright · 2020
You've probably seen a notice like this: "This old version of the app will stop working next month — please upgrade." Inside big companies the same thing happens constantly, except the thing being retired is a program: an old system has been replaced by a new one, but hundreds of other programs still rely on it. This chapter is about how to switch off something everyone is using without dragging everyone down with it.
A city builds a new bridge. The old one is crumbling and still costs money to maintain every year. So the city hangs a sign at the old bridge: "Please use the new bridge." What happens? Most new drivers take the new bridge — the regulars keep taking the old road. Habit, and the old route is saved in their navigation. The old bridge spends year after year "about to be torn down," and never is.
Taking something away is harder than building it. The more people use it, the more of them depend on it in ways you never imagined: a trucking company sends its lorries over the old bridge because the new one has a lower height limit. However good the new bridge is, it is never exactly the same, so every old user has to be checked again. Some people are attached to it — they built it. Worst of all, demolition costs visible money, while the cost of leaving it alone is invisible, so nobody wants to pay for it.
Removing a redundant bridge saves the upkeep, and the new bridge no longer has to match the old one's specs, so it can be upgraded freely. But don't close every road in town at once — take down a few bridges at a time, and finish each one. The honest cost: this needs dedicated people for months, and often nobody gives you credit, because on the day it's finally gone, no one is using it anymore.
Code is a liability, not an asset: turning off an old system takes an owner, a deadline and a moving crew — "please use the new one" alone never gets it switched off.
Want advisory vs. compulsory deprecation, how outages of increasing length flush out hidden dependencies, the two properties of a good deprecation warning, and the discovery / migration / backsliding toolkit? → Switch to the deep read
You think deprecation means slapping @deprecated on an old API and waiting for users to leave. The chapter says that almost never works: code is a liability; functionality is the asset. Turning off a widely depended-on system is an engineering project that needs an owner, a deadline, a dedicated migration team and tooling — and it is best considered when the system is first designed.
The last chapter of Part III, "Processes." It follows the four testing chapters (Ch11–14) — the global test suite is exactly how this chapter decides whether an old symbol is fully gone — and leads into Part IV, Tools, where code search, static analysis and large-scale changes are the means of carrying it out. Real-world counterparts: API sunsets, library upgrades, platform migrations, shutting down old services.
All systems age. The bits don't decay, but as the surrounding languages, libraries and techniques move on, an old system drifts away from its ecosystem: it needs dedicated maintenance, esoteric expertise, and ever more work. Age alone is not a reason to deprecate — LaTeX has been refined for decades and is still excellent. What should be deprecated is a system that is demonstrably obsolete, with a replacement offering comparable functionality.
Running old and new side by side costs more than it looks: if they must interoperate you need complicated translation code; once they depend on each other, removing either gets harder; and most insidiously, the new system has to stay compatible with the old one, which slows its evolution. This chapter is what Google learned deprecating large, heavily used internal systems — and the author admits it is one of the few topics in the book where "Google is still learning."
The chapter's premise in one line: code is a liability, not an asset. What's valuable is the functionality code provides; for the same functionality, one maintainable, understandable line beats 10,000 lines of spaghetti. So the thing to maximize isn't the amount of code but functionality delivered per unit of code — and the cheapest way is often not writing more, but deleting code and systems no longer needed.
But deprecation has a capacity limit. The book's analogy: everyone loves freshly paved roads, but if the city closed every road at once to repave, nobody could go anywhere. An organization can only absorb so much deprecation at once — for the teams doing it and for the customers forced to migrate. So choose deprecation projects carefully, and once chosen, finish them.
That leads to a counterintuitive conclusion: evolving a system in place is often cheaper than replacing it. Google has observed that migrating to entirely new systems is extremely expensive and the cost is frequently underestimated; incremental in-place refactoring doesn't avoid deprecation, but cuts it into smaller pieces that each deliver value.
In other engineering disciplines this isn't radical: a nuclear power plant's decommissioning decades later is part of its design, even with funds set aside for it (the book cites a 1997 IAEA technical report). Software rarely thinks this way: engineers prefer building new things, and corporate culture (Google's included) rewards shipping fast. Google encourages teams to ask two questions while designing: How easy will it be for my consumers to migrate to a potential replacement? Can I replace parts of my system incrementally?
More fundamentally: whether to support a project long term is decided when the organization decides to build it. Once a system exists, there are only three options: support it, carefully deprecate it, or let it stop working when some external event breaks it. So don't start projects your organization isn't committed to supporting for its expected lifespan.
Deprecation is a continuum, from "we hope to turn this off someday" to "this goes away tomorrow, be ready." The book splits it in two.
Advisory deprecation has no deadline and the organization isn't willing to commit resources — "aspirational" deprecation. It's good for advertising a new system and attracting early adopters, provided the new system can already handle production loads and is ready to be supported indefinitely, not still in beta. Only when the new system's benefits are transformative rather than incremental will notifications plus self-service migration tools drive adoption on their own — and even then, never to completion. Google's experience: putting up a deprecation warning and walking away leads to slightly fewer new uses, but rarely to teams actively migrating. The reason is a kind of pull: the more existing uses the old system has, the more new code copies them. As friends in SRE like to say: "Hope is not a strategy."
Compulsory deprecation comes with a removal date; systems still depending on it after that date will break. Three requirements:
Even with policy behind it there are political hurdles: if the last remaining user is critical infrastructure the whole company depends on, would you really break it to make a date? If that team can veto progress, the deprecation isn't really compulsory.
Flushing out hidden dependencies: the monorepo and dependency graph give Google deep insight into usage, but some teams don't even know they depend on the old system, and static analysis can miss it. The answer is dynamic: in the months and weeks before turndown, announce planned outages of increasing duration and see what breaks — much like Google's DiRT disaster-recovery exercises, these often uncover unknown dependencies between running systems, letting dependents plan or negotiate the timeline. At the code level, Google occasionally renames implementation-only symbols to see who depends on them unknowingly.
Warnings can prevent new uses but rarely migrate existing ones, and they accumulate: A depends on B, B on C, C's warning surfaces when A is built — enough of them and users ignore them all, what health care calls alert fatigue. So every warning needs two properties:
Google's approach is mark liberally, surface sparingly: old functions are freely marked deprecated, but tools like ErrorProne and clang-tidy flag them only on newly changed lines; intrusive warnings such as for deprecated targets in the dependency graph are added only for compulsory deprecations where the team is actively moving users away.
It needs explicit owners. Without them, no number of warnings produces progress. The alternatives are worse: never deprecate anything, or delegate it to users — which is just an advisory deprecation that will never finish organically. The hardest case is the abandoned project: the original owners moved to the successor, the old system chugs along "in the basement," still a dependency of something critical, everyone hoping it fades away. It won't. The owning team must make removal its primary goal, not a side project, or it always loses on priority; such important-not-urgent cleanup is also a great use of 20% time.
It needs incremental milestones. When building, every feature launch is a win; in deprecation it can feel like the only milestone is "turning out the lights and going home" — and if the team did its job, almost nobody outside notices, because by then nobody uses it; some deprecations never get there at all. So set measurable incremental milestones that deliver value, such as deleting a key subcomponent, and celebrate them like a launch.
Discovery runs throughout: Code Search and Kythe statically find who uses a library, and sampling shows which behaviors customers unexpectedly depend on; dynamic dependencies come from production logging and runtime sampling. New information may make you revisit the deprecation decision itself. Finally, the global test suite is the oracle for whether every reference to an old symbol is gone — and customers are responsible for having enough tests that removing the old system won't hurt them. Migration relies mainly on the LSC process and code generation and review tooling. Backsliding prevention is the most overlooked: without it, users keep adding uses from familiarity or from examples elsewhere in the codebase, and the deprecation team plays a counterproductive, demoralizing game of whack-a-mole. At the micro level, owners add compiler annotations to deprecated symbols (like Java's @deprecated), Tricorder surfaces new uses at review time, sometimes with a push-button fix; at the macro level, visibility whitelists (allowlists) in the build system stop new dependencies, and automated tooling periodically prunes them as users migrate away.
Table 1 · Advisory vs. compulsory: not which is better, but how much you're willing to pay
| Dimension | Advisory | Compulsory |
|---|---|---|
| Deadline | None | Yes; past it, things break (schedule can move) |
| Who does the work | Users, voluntarily | A dedicated expert team, centrally |
| Effect | Slightly fewer new uses; existing uses barely move | The old system actually gets deleted |
| Cost | Old system consumes maintenance indefinitely | People and enforcement power; unstaffed, it reads as an unfunded mandate |
| Warning intensity | Only on newly changed lines | Intrusive dependency-graph warnings allowed |
| When to pick | Advertising a new system with transformative benefits | Cost of running two systems clearly exceeds cost of migrating |
Table 2 · Facing an old system: the four options and their bills
| Option | Fits | Honest cost |
|---|---|---|
| Keep supporting | Still the best solution, just old (like LaTeX) | Ongoing maintenance; grows as the ecosystem drifts |
| Evolve in place | Most cases; refactorable piece by piece | Doesn't avoid deprecation, only slices it; needs a system whose parts can be replaced |
| Replace + deprecate | New system proven better with comparable functionality | The book says costs are frequently underestimated; translation code during coexistence |
| Let it break | Small company, single project, no dependents | An external event picks the moment — usually the worst one |
Another trade-off is how many deprecations to run at once: the more you open, the heavier each customer team's migration load. Better to open fewer and finish them.
Asking "how will we turn this off one day?" in a design review is cheapest then — few dependents, interfaces still malleable. In an interview about "migrating an old library that hundreds of services depend on," laying out the chain discover → migrate centrally → outages of increasing length → block backsliding → delete beats "send an email asking everyone to upgrade."
Industry evidence · publicly verifiable
① Code is a liability, functionality the asset: maximize functionality per unit of code; deleting redundant systems is the cheapest lever.
② Deprecate what is demonstrably obsolete with a replacement, not what is merely old; coexistence slows the new system's evolution.
③ It's hard because of Hyrum's Law (removal is the ultimate change), no one-to-one match, emotional attachment, and invisible costs.
④ Counting turndown costs, evolving in place usually beats replacing; long-term support is decided when the project starts.
⑤ Advisory has no deadline and only nudges; compulsory needs a deadline, enforcement and a staffed expert team — or it's an unfunded mandate.
⑥ Planned outages of increasing duration and renamed internal symbols flush out unknowing dependents.
⑦ Good warnings are actionable + relevant; mark liberally, surface sparingly, only on newly changed lines, to avoid alert fatigue.
⑧ Run it as a project: explicit owners and celebrated intermediate milestones; abandoned projects never fade away on their own.
⑨ The toolkit: discovery (code search / logs / global tests), migration (LSC), backsliding prevention (annotations + visibility allowlists).