[h] home [b] blog [n] notebook

maps, territories, and the software in between

Korzybski's famous dictum is "the map is not the territory." There's a software corollary that nobody talks about. Most software is a map. And most software bugs are map-territory mismatches.

A database schema is a map of reality. It says "a user has one email address" or "an order belongs to one customer." These are simplifications. Reality is messier. People share email addresses. Orders get transferred. Edge cases multiply. The schema imposes a clean geometry on a rough world.

The Abstraction Gap

Every line of code is an assertion about the world. "This will always be a positive integer." "This list will never be empty." "This API will respond within 500 milliseconds." These assertions are the map. The territory is whatever actually happens at runtime.

Good engineering is largely about choosing the right level of map fidelity. Too abstract, and your map is useless. It can't guide real decisions. Too detailed, and your map becomes as complex as the territory itself. Then it defeats the purpose of having a map at all.

Where Maps Fail Interestingly

The most interesting bugs I've encountered were all map-territory problems. A payment system that modeled refunds as negative charges. Clean map, but it broke when partial refunds were introduced. A scheduling system that assumed all time zones have 24-hour days. Clean map, but daylight saving time is a wrecking ball.

The pattern is always the same. Someone drew a map that was good enough for the initial territory, and then the territory expanded. The map didn't just become inaccurate. It became dangerous because people trusted it.

Living with Imperfect Maps

The pragmatic response isn't to make perfect maps. It's to build systems that acknowledge their own imperfection. This means defensive coding, yes. But more importantly, it means designing systems where the consequences of map failure are small and recoverable.

The best systems I've seen are the ones that fail gracefully when their maps are wrong. Not because the engineers anticipated every edge case. They built in the expectation that their maps would eventually be wrong about something.


Humility in code is rare and valuable. The most robust systems are the ones that quietly whisper: "I might be wrong about this."