Chapter 11: Design

Coupling

How much one module has to know about another. If changing A forces you to change B, they are coupled. Modules have to talk to each other, so you can't get rid of it. The questions are how much, and whether you can see it.

The ripple of a change is what an agent has to hold in context and what a reviewer has to read. An import is usually the shortest way to a working change, so agents add them freely, and no test fails when the graph gets tangled. You need a separate sensor for this.

Say it to your agent

“Show me every file that imports src/billing/tax.ts, directly or through another file. If that is more than five, put a narrow interface in front of it, so callers depend on the interface and nothing else.”

The workshop

Name a word, or describe what you mean in everyday language.