Lesson 3 of 17 · Setting the Stage
The Cost of Change Curve
The same change, two prices
Imagine the following scenario: In week two, you add a column to the users table, surface it on the registration form, and ship it before lunch. Total time: maybe an hour. The "complicated" part is getting the validation message right.
In year three, the same change takes three weeks.
The line of code didn't get harder. Everything around it got heavier.
That's the cost of change curve, and it's the shape behind most of what this course teaches.
What the curve actually looks like
If you put time on the X axis and the cost of making a typical change on the Y axis, the line doesn't go up in a straight diagonal. It curves. It's flat for a while, then it bends, and once it bends it climbs faster than you expect.

First, the curve bends rather than climbing at a steady rate. Each year doesn't add the same cost on top. Each year adds more than the last one did, because every decision you've already shipped becomes another constraint on the next decision.
Second, the X axis is not really "time". It's "accumulated decisions". A product that ships ten features a year reaches the steep part faster than one that ships two. A team that adds five engineers a year piles up decisions faster than a small team that's been around twice as long. Time is a proxy for the thing that actually matters.
What makes the curve steep
The curve doesn't bend because code mysteriously becomes harder. It bends because of forces that compound:
More callers. A function with one caller is cheap to change. A function with forty callers requires you to understand all forty before you touch it.
More implicit coupling. Things start to depend on each other in ways nobody documented. The test suite breaks "for unrelated reasons" when you change a model. The reason isn't unrelated; it just isn't visible.
More tests that lock current behavior. Tests are usually a feature, but every test is also a vote against changing the thing it covers. Once the suite is big enough, a real share of your changes break tests that aren't wrong, just specific.
More developers. A change that fits in one head needs no coordination. A change that crosses three teams needs meetings, design docs, and somebody to wait on. That cost is paid every time, not once.
More production data shapes. A column in a thousand rows is easy to migrate. A column in a hundred million rows is a project. The data drags on the code.
More tribal knowledge. Some of why the code looks the way it does lives only in the head of someone who left two years ago. Every change costs an extra "ask someone" step.
More external integrations. Every API you call, webhook you receive, queue you publish to, partner you sync with is one more thing your change has to be compatible with.
None of these are bugs. They're what building a real product over time costs, and they compound, which is the part that surprises people.
A worked example
Say the week-two change was preferred_language on a user: a column, a field on the registration form, one test, done by lunch. Here is the same field in year three.
usersis wide and busy, so the migration can't just be run. It gets rehearsed against a copy of the production database first, because locking the real table in the middle of the day would take the site down.Registration is one of five sign-up flows. Mobile signup, social signup, invite-link signup, partner-API signup, internal admin signup.
The user object is exported nightly to a data warehouse, and the warehouse schema is owned by a different team.
Two queue jobs run daily off the user record. One of them caches a serialised copy of the user, so every write now has a cache to invalidate as well.
Customer support has a tool that reads the users table directly. They'll need to be told.
Marketing has tied existing language preferences to email templates. They want a meeting.
The mobile app is on a six-week release cycle and won't pick up a new field for at least one of those.
A partner integration sends user data over webhook. Their docs need to be updated.
Personal data has retention rules. Adding a field opens a small compliance question.
Not one of those nine items is about writing the code.
The myth of the flat curve
The most common reaction to all this is, "we'll just refactor when we need to". That's a defensible plan only if the curve is flat.
The trouble is that the need arrives long before the feeling does. None of the forces in that list announce themselves. Each one is small enough to absorb on the day it lands, and no single one of them is what broke things. What you eventually notice is the sum. By then every one of those small additions has become something your refactor has to keep working.
By the time you can feel that you need to refactor, the cost of refactoring has already climbed onto the steep part. You don't "just" pull a billing rule out of the User model in year three. You schedule a project, you risk regressions in unrelated features, you negotiate with three teams who depend on the current shape, and you discover halfway through that some of the rules don't even live in the User model anymore. They migrated to a queue job two years ago and nobody updated the wiki.
"Refactor when we need to" works on the flat part of the curve. On the steep part, it turns into "live with it forever, or budget six months for the rewrite that won't happen".
The myth of the vertical wall
The opposite trap is just as expensive. "If we don't get the architecture right now, we'll never be able to fix it later, so we have to design everything up front."
The curve is steep. It is not vertical. Early decisions can be undone. They cost more to undo later than to make differently up front, but they don't become impossible. Treating year-one decisions as if they were carved in stone leads to two months of architecture meetings before anyone writes a line of feature code. It also leads to scaffolding for problems you may never have, paid for in the velocity you don't yet have to spare.
The worst codebases I've seen were shaped by a small number of irreversible-feeling decisions, made early, by people trying very hard to do the right thing for a future they couldn't actually see.
The honest position is in the middle. You won't predict the future, and you don't have to. You just have to keep the curve from going vertical before the product gets where it's going.
What flattens the curve
The rest of this series is essentially a list of things that keep the curve flatter for longer. Some get a lesson in this course, the rest come later in the series:
Clear boundaries between concepts that don't have to know about each other.
Honest dependencies: if a class needs five things, the constructor says so.
Naming by intent, so future readers don't have to reconstruct what the code is for.
Tests that describe behavior, not implementation, so they don't fight every change.
Small files with one reason to change.
Business logic that lives with the business, not scattered across the framework.
None of these are free. Each costs a little extra now in exchange for a flatter curve later. The skill, which we'll keep coming back to, is knowing how much of that extra cost the situation can afford.
What you can't flatten
Some of the cost of change is unavoidable, no matter how well the code is written.
A five-year-old product with paying customers, production data, partner integrations, and regulators will always be more expensive to change than a blank repository on a Monday morning. That's not a failure of architecture; it's what having real customers costs.
The goal is a curve that bends late and bends gently, so the product has room to grow into its full size before the team starts grinding to a halt.
How to use this in real decisions
When you estimate a feature, you usually estimate the change itself. "About two days." That estimate is built around the size of the diff.
Real cost is closer to: size of the diff, multiplied by where you are on the curve. A two-day change in week two is two days. A two-day change in year three is rarely two days.
You don't need to put a number on this. You just need to remember that the curve exists, and let it pull your estimates and your decisions in the right direction. When something feels suspiciously easy in year three, it usually isn't. When something feels overwhelming in year three, it usually is, and the work is to break the change down until each piece touches few enough things to be cheap again.
The one thing to remember
Code is cheap to change in year one and expensive to change in year three, and the difference is almost never in the code itself.
Estimate and design as if you knew that. The curve is going to bend regardless. How late it bends, and how gently, is the part you control.
Exercise
Before moving on, pick whichever one of these fits your situation better.
If you have an active project: Take the last small feature you shipped, the kind that should have been a one-day change. Write down every step between "I understand what's being asked" and "it's running in production".
How much of that time went into writing code?
How much went into reading code to work out what the change would touch?
How much went into waiting on other people or other systems?
Which of those three would have been shorter a year ago, and why?
If you don't have an active project: Take the year-three list from this lesson. Pick three items off it and work out what would have had to be true earlier in the product's life for that item not to be on the list at all.
Which of the three could have been avoided by an earlier design decision, and which are simply the cost of the product being real?
What would that design decision have cost in week two, before anyone knew it would matter?
Either way, the point is to separate the part of the curve you control from the part you don't.
Related Links
- The Design Stamina HypothesisMartin Fowler's graph of cumulative functionality with and without ongoing design effort.
- Is High Quality Software Worth the Cost?Martin Fowler on how low internal quality slows delivery within weeks, not years.
- Refactoring (2nd Edition)Martin Fowler's catalog of the small changes that keep the curve flat.