The Tokyo Theory

This is the English version of this article.


The Broken Window Theory

The seminal work on programming best practices Pragmatic Programmer introduces the Broken Window Theory:

Researchers studying urban decay wanted to find out why some neighborhoods escape the ravages of the inner city, and others right next door—with the same demographics and economic makeup—would become a hell hole where the cops were scared to go in. They wanted to figure out what made the difference.

The researchers did a test. They took a nice car, like a Jaguar, and parked it in the South Bronx in New York. They retreated back to a duck blind, and watched to see what would happen. They left the car parked there for something like four days, and nothing happened. It wasn’t touched. So they went up and broke a little window on the side, and went back to the blind. In something like four hours, the car was turned upside down, torched, and stripped—the whole works.

They did more studies and developed a “Broken Window Theory.” A window gets broken at an apartment building, but no one fixes it. It’s left broken. Then something else gets broken. Maybe it’s an accident, maybe not, but it isn’t fixed either. Graffiti starts to appear. More and more damage accumulates. Very quickly you get an exponential ramp. The whole building decays. Tenants move out. Crime moves in. And you’ve lost the game. It’s all over.

The theory is an analogy for how technical debt can accumulate, eventually causing the project to implode. A single, broken abstraction becomes the gateway for all manners of hacks that eventually result in intractable complexity.

We’ve all been in such software projects, but in my opinion, the most frightening aspect is that sometimes, everyone involved is dumbfounded. How could a few corner-cutting decisions wreak such complete destruction?

And more importantly, what could we have done differently?

The Tokyo Theory

I moved to Tokyo to study Japanese, but stuck around to work at a software firm. In comparison to the typical American metropolis like San Francisco or New York City, one aspect in particular stands out even now.

The city is immaculate. There is no litter. Even the milling hordes of tourists, as if obeying an invisible force of Japanese nature, elect to hold on to their grimy onigiri wrappers to throw away back at their overpriced hotels.

And yet, after living here for three years, I know that this city has its share of broken windows, too. Tokyo merely does not present itself this way.

Could it be that the “Broken Window Theory” applies in both directions? That by maintaining an appearance of cleanliness, a project could be similarly shielded from the chaotic process of development. There doesn’t seem to be a requirement for true cleanliness either, simply that the engineer perceives it to be so.

We can call it the “Tokyo Theory”.