Book Deep-Read · A Philosophy of Software Design · Chapter 2

The Nature of Complexity

A Philosophy of Software Design · Ch 2 · The Nature of Complexity · Ousterhout · 2nd ed 2021

中文 →

What is this chapter about?

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."

A strange thing first

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.

Why the old world was hard

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 —

The core intuition

What it gives you / how to choose

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.

One line to remember

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