Book Deep-Read · A Philosophy of Software Design · Chapter 19
A Philosophy of Software Design · Ch 19 · Software Trends · Ousterhout · 2nd ed 2021
Every few years the software world adopts a new "right way" to work: object-oriented programming, agile, test-first, design patterns. Each has true believers. In this chapter the author takes the one ruler he has used all book long — "does this make the system simpler or more complicated?" — and measures each fashion with it.
Think of diet trends: keto, fasting, meal shakes. The sensible person doesn't ask "what's popular this year?" but "is this actually making me healthier?" Some trends genuinely help; some make the scale look good this month and leave you worse off in the long run.
Popular methods come as bundles. Half of the bundle is genuinely good; the other half is just habits that came along for the ride. A team that adopts the whole package picks up the bad half too — and rarely notices, because "everyone does it this way."
When a new trend arrives, don't start with "is everyone using it?" Start with "does it make the system simpler?" One honest cost: this ruler is the author's experienced judgment, and plenty of practitioners — test-first advocates especially — disagree with his verdicts.
Popularity is not a reason; measure every new practice again with one question — does it reduce complexity?
Want the difference between interface and implementation inheritance, why "increments should be abstractions, not features," and the author's public debate on TDD with the author of Clean Code? → Switch to the deep read
You might think this chapter just reviews a few fashionable methodologies; it is really demonstrating a test: hold up the book's single yardstick — complexity — against object-oriented programming, agile, unit tests, TDD, design patterns, and getters/setters. The verdicts are mixed: interface inheritance and unit tests reduce complexity; implementation inheritance, TDD, and overused patterns and accessors tend to add it. The real takeaway is the closing line: whenever you meet a new paradigm, challenge it from the standpoint of complexity.
getName().Chapter 19, after the run on comments, naming, consistency, and obvious code: the book turns from "how to write" to "are the popular practices right?" It leads into Chapter 20, "Designing for Performance," which tests another common excuse against complexity.
Teams rarely adopt a methodology because someone calculated its effect on complexity; they adopt it because "the industry does it." The trouble is that methodologies bundle good and bad together: agile's small iterations are right, but its accompanying "ship now, design later" pushes teams toward tactical programming; object orientation's private variables are information hiding, while implementation inheritance creates dependencies across classes.
Accept the bundle uncritically and a codebase maintained by a dozen people for years accumulates complexity in the name of "best practice" — and nobody questions it, precisely because it is best practice. The chapter unpacks each trend: which part really lowers complexity, and which does not.
The author first credits one part of object orientation: private methods and variables directly serve information hiding. Then he splits "inheritance" in two.
Interface inheritance: the parent defines method signatures without implementing them, and each subclass implements the same interface. This is leverage against complexity: learn one interface and use it in many situations. His example is I/O: the same read/write interface works for disk files and for network sockets. In Chapter 4's terms, the more implementations an interface has, the deeper it becomes — more is hidden behind it, while readers still learn only a handful of methods.
Implementation inheritance: the parent also supplies default method implementations that subclasses reuse or override. It saves duplicated code, and a change in the parent flows to every subclass. The cost is a dependency between parent and subclasses: they often read and write the same instance variables, which is information leakage, and understanding or changing any class in the chain often means reading the whole hierarchy. So the author advises caution: first consider whether composition — moving shared logic into small helper classes — gives the same benefit; if you must inherit, separate the state managed by the parent from the state managed by subclasses, so certain instance variables are owned entirely by parent methods and subclasses only read them or go through those methods.
The heart of agile development is incremental, iterative work: build a small piece, evaluate, adjust. The author agrees — no one can get the abstractions of a large system right up front; they must be fixed along the way.
The risk is that agile slides into tactical programming: it focuses developers on delivering features and encourages putting off design decisions to get working software out as soon as possible. His correction is the line to remember from this chapter: the increments of development should be abstractions, not features. It is fine to wait until you actually need an abstraction, but once you do, take the time to design it cleanly and make it somewhat general-purpose.
The author calls himself a strong supporter of unit tests, for a design reason: tests make refactoring safe. Without a test suite, any major structural change risks bugs that go unnoticed, so developers avoid refactoring and make only minimal patches — exactly how complexity piles up. With good unit-test coverage, you rerun the suite after a change and know immediately whether you broke something, which gives you the nerve to make strategic improvements. He also distinguishes unit tests from system tests, which check that the parts of an application work together and are often written by a separate testing team.
Test-driven development (TDD) has you write a test first, then just enough code to make it pass. The author dislikes it for the same reason as agile's risk: TDD focuses attention on getting one specific feature working rather than finding the best design — tactical programming in its typical form. Development is too incremental, there is no obvious moment to do design, and it is easy to "hack until the test passes."
He makes one exception: write the test first when fixing a bug. Write a unit test that fails because of the bug, then fix it and watch the test go green. That proves the fix works and keeps the bug from coming back.
A design pattern is an established solution to a recurring kind of problem, such as iterator or observer. The author grants their value: when the problem matches, applying a pattern everyone recognizes saves design effort and lightens the reader's load (this is really Chapter 17's consistency at work). The greatest risk is over-application: forcing a problem into a pattern when a custom approach would be cleaner. Using design patterns doesn't automatically improve a system; it only does when the pattern fits — and more patterns are not better.
In the Java world, "private field plus a getter/setter pair" is nearly the default. Supporters argue that accessors let you add logic on read or write, and let you change the internal representation without changing the interface. The author answers on two levels. First, getters and setters are shallow methods — usually one line — that clutter the class interface while providing almost no functionality. Second, and more fundamentally, exposing instance variables through getters and setters is still exposing the implementation, which violates information hiding. So his advice is not "write better accessors" but avoid exposing implementation data as much as possible; accessors make some sense only when an instance variable truly must be exposed.
The chapter ends with a meta-rule: whenever you encounter a proposal for a new software development paradigm, challenge it from the standpoint of complexity — does it really help minimize complexity in large software systems? Many proposals sound good on the surface, but look deeper and some make complexity worse.
Table 1 · The complexity ledger for six trends
| Trend | Part that reduces complexity | Part that adds it | Author's stance | Cost / limit |
|---|---|---|---|---|
| Interface inheritance | One interface reused across impls, deeper with use | — | For it | Pays off only if the interface is stable |
| Implementation inheritance | Less duplicated code | Shared parent/child state; read the whole hierarchy | Caution; try composition first | Composition needs forwarding code |
| Agile | Iterate, fix abstractions as you go | Features first, design deferred | For it, but increments = abstractions | Each delivery chunk is larger and slower |
| Unit tests | Safety net for refactoring | — | Strongly for | Cost of writing and maintaining tests |
| TDD | Coverage, problems found early | Tactical, fragmented increments | Against (except bug fixes) | Contested; see pitfalls |
| Design patterns | Familiar solutions readers recognize | Forcing one in → over-design | Use when it fits | Requires judging whether it truly fits |
| Getters/setters | Room for logic on read/write | Shallow methods; implementation still leaks | Avoid where possible | Clashes with Java convention |
The decision test is three questions: does it reduce dependencies between modules? Does it make important information more visible? Does it make strategic rather than tactical changes easier? A practice that answers "no" to all three is just a habit, however popular.
Several of the chapter's judgments have public echoes — and public rebuttals — in mainstream language design and big-company guidelines.
Industry evidence · publicly verifiable
fmt.Fprintf printing to any output, not just a file — nearly this chapter's "interface inheritance is leverage, implementation inheritance is a burden," built into a language. Source: Go FAQ · Why is there no type inheritance?In daily work: when a review shows a new abstract base class and a three-level hierarchy, ask whether interfaces plus composition would do; when planning an iteration, treat "a clean, finished module" as a unit of delivery; set up unit tests on a new service before talking about refactoring; and when you see a row of one-line getters and setters, ask why callers need that internal data at all.
① The chapter models a method: test every popular practice against one yardstick, complexity, and separate its good half from its bad half.
② Object orientation: private members serve information hiding; interface inheritance is leverage, and more implementations make the interface deeper.
③ Implementation inheritance creates parent/child dependencies and information leakage; try composition first, and if you must inherit, separate parent and subclass state.
④ Agile's iteration is right, but increments should be abstractions, not features; when you need an abstraction, design it cleanly.
⑤ Unit tests are the safety net for refactoring and the author strongly supports them; without tests, people only dare to patch.
⑥ The author sees TDD as tactical programming; the exception is writing a failing test first when fixing a bug.
⑦ Design patterns help when they fit; forced patterns are over-design; more is not better.
⑧ Getters and setters are shallow and still expose the implementation; avoid exposing implementation data.
⑨ Evidence: Go has no type inheritance; Google's Python guide turns trivial accessors into public attributes; Martin and the author debated TDD publicly, and the author conceded the description but not the stance.