Book Deep-Read · A Philosophy of Software Design · Chapter 2
A Philosophy of Software Design · Ch 2 · The Nature of Complexity · Ousterhout · 2nd ed 2021
The last chapter said "building software is a war against complexity." But you can't fight an enemy you can't see. This chapter draws its portrait: what complexity looks like, where it comes from, and how it piles up. Once you have that, you can point at a piece of code and say "it got complicated right here," instead of just feeling that it's "messy."
People who write code usually think their own code is pretty simple; someone else reads it and is lost. The author's ruling is blunt: whether code is complex is decided by the reader, not the writer. You have all the background in your head, so it feels smooth to you. The new teammate doesn't, and wherever they get stuck — that's complexity.
Picture a website where every page has a colored banner across the top, and the color is typed out separately in every page. The boss says: change the color —
With this portrait, judging code stops being a gut feeling. Ask three questions: how many places do I have to touch? How much do I need to remember first? Is there a hidden trap? If the answers are bad, go find where things got too tied together or where something wasn't made clear. One honest cost: there's no ruler for these judgments — they rest on experience and other people's feedback, and reasonable people will argue.
Complexity means "hard to understand, hard to change," as judged by the reader; it shows up as three kinds of pain, its roots are hidden ties and unclear information, and it accumulates bit by bit — so don't let any bit slide.
Want the precise definition and its weighting intuition, the full examples of the three symptoms, how dependencies and obscurity cause them, the "zero tolerance" principle, plus Hyrum's Law, Google on ML technical debt, and the Knight Capital incident? → Switch to Deep
You think complexity means lots of code or a big system. Ousterhout's definition: anything related to the structure of a software system that makes it hard to understand and modify. It shows up in only three symptoms — change amplification, cognitive load, unknown unknowns; it has only two causes — dependencies and obscurity; and it is never one big mistake but hundreds of "just a little bit" choices that accumulate incrementally. So the only workable stance is zero tolerance.
Chapter 2, which defines the enemy Chapter 1 named. It builds on "the goal of design is to contain complexity" and leads into Chapter 3, tactical vs strategic programming (why complexity keeps piling up), and Chapter 4, deep modules (the first weapon against it). Nearly every red flag later in the book traces back to this chapter's three symptoms or two causes. In practice it maps to every code review where someone asks, "why is this change so hard?"
Everyone agrees with the slogan "reduce complexity," but you can't manage what you haven't defined. In a review you say "this is too complex," the author replies "it looks clear to me," and the conversation is over. This chapter supplies a recognizable definition so people can spot complexity before a system grows out of control.
A scenario to anchor on (illustrative): an old website with 200 pages, the brand color written separately in each one. Changing the brand color should take five minutes; in reality it becomes two days of "search the whole repo, confirm each hit, ship, then clean up the pages you missed," plus a stretch in production where the site is half old and half new. No single line of code is "wrong," yet the system is hard to change — this chapter explains where the difficulty lives, why, and where it starts.
The author gives a practical definition: complexity is anything related to the structure of a software system that makes it hard to understand and modify. Hard to understand and modify means complex; easy means simple. You can also see it as cost versus benefit: in a complex system, even a small improvement takes a lot of work; in a simple one, large improvements come cheaply.
It is not code size. A large system with a clear structure can be simple; a small module full of implicit conventions can be very complex. The author also offers a weighting intuition: C = Σ c_p · t_p — total complexity is the complexity c_p of each part p, multiplied by the fraction of time t_p developers spend on that part, summed. In plain words: complexity counts by how much people actually touch it. A horribly complex chunk that almost nobody has to work in contributes little; so isolating complexity where it will never be seen is almost as good as eliminating it. That is exactly why encapsulation pays.
The second point is to side with the reader: complexity is more apparent to readers than to writers. If you write code that seems simple to you but others find it complex, then it is complex. In the author's words, your job as a developer is not just to write code you can work with easily, but code others can work with easily too. That is also why Chapter 1 recommends learning design through code review.
① Change amplification: a seemingly simple change requires edits in many places. The book's example is exactly the banner: early websites often set the background color explicitly on every page, so changing it meant editing every page. The fix is a central variable that each page references — change one place.
② Cognitive load: how much a developer needs to know to complete a task. Higher load means more time to learn and more risk of a bug from a missed detail. The book's example: a C function that allocates memory, returns a pointer, and expects the caller to free it — every caller must remember the rule, and forgetting leaks memory. The author flags a counterintuitive point: designers often measure complexity in lines of code, but sometimes an approach that takes more lines is actually simpler, because it reduces cognitive load.
③ Unknown unknowns: it's not obvious which code must change to complete a task, or what information you need to do it. This is the worst of the three: with the first two you at least know where the cost is; with this one, you only find out when a bug appears. Extending the banner example: even with the color centralized, if some pages use "a darker shade of the banner color" for emphasis, and that shade is hardcoded per page, changing the central variable won't update them — and nothing tells you those pages exist.
Together they lead to a key word for the whole book: a mark of good design is that the system is obvious — a developer can quickly understand how existing code works and what a change requires, guess what to do, be right, and be confident in that guess.
Dependencies: a piece of code can't be understood or modified in isolation. The book's examples: a function's signature creates a dependency between the function and all its callers — change the signature and the callers must change; a network protocol creates a dependency between sender and receiver. The author stresses that dependencies are a fundamental part of software and can never be completely eliminated; in fact we introduce them on purpose. The goal is to reduce the number of dependencies and make the remaining ones as simple and obvious as possible. Figure 1(b) is the model case: the central variable actually adds a dependency (every page depends on it), but it is clear and centralized, so complexity goes down.
Obscurity: important information is not obvious. Examples: a variable name so generic it says little (just time, with no unit or meaning); missing documentation, so the reader must dig into the implementation to learn what a return value means; inconsistency — the same name used for different things in different places, so the reader can't tell which one applies here. Obscurity often travels with dependencies: the dependency exists but isn't visible (the navy shade in Figure 1(c)). The author's verdict is sharp: if a design needs extensive documentation to explain, that is often a red flag that the design isn't quite right; the best way to reduce obscurity is to simplify the design, and documentation comes second.
Mapping causes to symptoms: dependencies lead to change amplification and cognitive load; obscurity creates unknown unknowns and also adds to cognitive load. Any design technique that reduces dependencies and obscurity eases all three symptoms.
Complexity isn't caused by a single catastrophic error; it accumulates from hundreds or thousands of small dependencies and obscurities. Each one alone looks harmless, so it's easy to tell yourself, "a little bit won't hurt." But when every developer thinks that on every change, the total becomes overwhelming — and by then it's very hard to remove, because what you'd have to fix is thousands of small things. The author's conclusion: you must adopt a "zero tolerance" philosophy. This thread leads straight into Chapter 3: why "just get it working" tactical programming makes complexity compound.
Table 1 · The three symptoms: how to spot them, where the cost lands
| Symptom | Signal in review | Main cause | Cost |
|---|---|---|---|
| Change amplification | One requirement's diff is spread across many files, all making the same edit | Dependencies (often duplicated) | Slow; but visible, and search can catch it |
| Cognitive load | Spoken rules like "before calling this, remember to…" or "you must call X first" | Dependencies + obscurity | Slow onboarding, easy to miss things; scales with team size |
| Unknown unknowns | All tests pass, and only in production do you find something didn't follow the change | Obscurity (hidden dependencies) | Most expensive: no signal until the bug |
Table 2 · Facing a dependency: what to do with it
| Approach | Example | You get | Cost / risk |
|---|---|---|---|
| Copy-paste | Color typed into every page | Fastest today; pages don't touch each other | Change amplification; miss one and it's inconsistent |
| Central and explicit | A central variable, shared constant, clear interface | One edit; the dependency is visible at a glance | One more dependency; every user feels each change |
| Implicit | Hand-coded derived shade; conventions "everyone knows" | Looks clean on the surface | Unknown unknowns; hardest to debug |
| Eliminate it | Redesign so the information is no longer needed in two places | Best; the dependency is gone | Often means rethinking the problem; highest upfront cost |
The rule of thumb: keep dependencies few and explicit; one dependency everyone can see beats two that are hidden. In review, ask three things — how many places does this touch? What must I remember before changing it? Is there anything that won't break loudly if I forget it?
When an interviewer asks "what is good design?" or "how do you measure code quality?", this chapter gives a more usable answer than "high cohesion, low coupling": name the three symptoms and two causes, then give one example of a hidden dependency. In an architecture review, "does this change introduce unknown unknowns?" is the single most useful question — it usually points at unwritten conventions, config shared across services that nobody owns, or a field whose meaning got reused.
Industry evidence · public sources
C = Σ c_p · t_p is a thinking tool — weigh by how much people actually touch the code — not a measurable metric.① Complexity: anything related to a system's structure that makes it hard to understand and modify; not the same as code size.
② Weight it by how much people actually touch it; isolating complexity where nobody needs to look is almost as good as removing it.
③ Complexity is more apparent to readers than writers; the reader's experience is the judge.
④ Three symptoms: change amplification, cognitive load, unknown unknowns; the third is worst because there's no signal before failure.
⑤ More lines can be simpler — lowering cognitive load matters more than saving lines.
⑥ Two causes: dependencies and obscurity; dependencies can't be eliminated, so keep them few and explicit; fix obscurity by simplifying the design first, documentation second.
⑦ The mark of good design is "obvious": guess how to make a change and you'll probably be right, and confident.
⑧ Complexity accumulates incrementally; "just a little" is how it grows, so tolerate none.
⑨ In the real world: implicit dependencies always appear (Hyrum's Law), and one name with two meanings can cause an incident measured in minutes.