Book Deep-Read · Software Engineering at Google · Chapter 15

Deprecation

Software Engineering at Google · Ch 15 · Deprecation · Hyrum Wright · 2020

中文 →

What is this chapter about?

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.

An analogy

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.

Why the old world was hard

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.

The core intuition

What it buys you / how to choose

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.

Remember it in one line

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