I <3 Steve McConnell*
Coding Horror
programming and human factors
by Jeff Atwood

June 23, 2005

The Broken Window Theory

In a previous entry, I touched on the broken window theory. You might be familiar with the Pragmatic Progammers' take on this:

Don't leave "broken windows" (bad designs, wrong decisions, or poor code) unrepaired. Fix each one as soon as it is discovered. If there is insufficient time to fix it properly, then board it up. Perhaps you can comment out the offending code, or display a "Not Implemented" message, or substitute dummy data instead. Take some action to prevent further damage and to show that you're on top of the situation.

We've seen clean, functional systems deteriorate pretty quickly once windows start breaking. There are other factors that can contribute to software rot, and we'll touch on some of them elsewhere, but neglect accelerates the rot faster than any other factor.

That's excellent advice for programmers, but it's not the complete story.

broken windows

The broken window theory is based on an Atlantic Monthly article published in 1982. It's worth reading the article to get a deeper understanding of the human factors driving the theory:

Second, at the community level, disorder and crime are usually inextricably linked, in a kind of developmental sequence. Social psychologists and police officers tend to agree that if a window in a building is broken and is left unrepaired, all the rest of the windows will soon be broken. This is as true in nice neighborhoods as in rundown ones. Window-breaking does not necessarily occur on a large scale because some areas are inhabited by determined window-breakers whereas others are populated by window-lovers; rather, one unrepaired broken window is a signal that no one cares, and so breaking more windows costs nothing. (It has always been fun.)

Philip Zimbardo, a Stanford psychologist, reported in 1969 on some experiments testing the broken-window theory. He arranged to have an automobile without license plates parked with its hood up on a street in the Bronx and a comparable automobile on a street in Palo Alto, California. The car in the Bronx was attacked by "vandals" within ten minutes of its "abandonment." The first to arrive were a family--father, mother, and young son--who removed the radiator and battery. Within twenty-four hours, virtually everything of value had been removed. Then random destruction began--windows were smashed, parts torn off, upholstery ripped. Children began to use the car as a playground. Most of the adult "vandals" were well-dressed, apparently clean-cut whites. The car in Palo Alto sat untouched for more than a week. Then Zimbardo smashed part of it with a sledgehammer. Soon, passersby were joining in. Within a few hours, the car had been turned upside down and utterly destroyed. Again, the "vandals" appeared to be primarily respectable whites.

Untended property becomes fair game for people out for fun or plunder and even for people who ordinarily would not dream of doing such things and who probably consider themselves law-abiding. Because of the nature of community life in the Bronx--its anonymity, the frequency with which cars are abandoned and things are stolen or broken, the past experience of "no one caring"--vandalism begins much more quickly than it does in staid Palo Alto, where people have come to believe that private possessions are cared for, and that mischievous behavior is costly. But vandalism can occur anywhere once communal barriers--the sense of mutual regard and the obligations of civility--are lowered by actions that seem to signal that "no one cares."

There's even an entire book on this subject. What's fascinating to me is that the mere perception of disorder-- even with seemingly irrelevant petty crimes like graffiti or minor vandalism -- precipitates a negative feedback loop that can result in total disorder:

We suggest that "untended" behavior also leads to the breakdown of community controls. A stable neighborhood of families who care for their homes, mind each other's children, and confidently frown on unwanted intruders can change, in a few years or even a few months, to an inhospitable and frightening jungle. A piece of property is abandoned, weeds grow up, a window is smashed. Adults stop scolding rowdy children; the children, emboldened, become more rowdy. Families move out, unattached adults move in. Teenagers gather in front of the corner store. The merchant asks them to move; they refuse. Fights occur. Litter accumulates. People start drinking in front of the grocery; in time, an inebriate slumps to the sidewalk and is allowed to sleep it off. Pedestrians are approached by panhandlers.

At this point it is not inevitable that serious crime will flourish or violent attacks on strangers will occur. But many residents will think that crime, especially violent crime, is on the rise, and they will modify their behavior accordingly. They will use the streets less often, and when on the streets will stay apart from their fellows, moving with averted eyes, silent lips, and hurried steps. "Don't get involved." For some residents, this growing atomization will matter little, because the neighborhood is not their "home" but "the place where they live." Their interests are elsewhere; they are cosmopolitans. But it will matter greatly to other people, whose lives derive meaning and satisfaction from local attachments rather than worldly involvement; for them, the neighborhood will cease to exist except for a few reliable friends whom they arrange to meet.

Programming is insanely detail oriented, and perhaps this is why: if you're not on top of the details, the perception is that things are out of control, and it's only a matter of time before your project spins out of control. Maybe we should be sweating the small stuff.

Posted by Jeff Atwood    View blog reactions
« UI is Hard
Keyboarding: Dell Minimalist »
Comments

The same thing applies to comment spam, which is why it's important to fight the good fight and clean it up.

Haacked on June 24, 2005 1:07 PM

Totally agree. I've had that exact thought before when browsing blogs totally overrun with comment spam. When the author has seemingly abandoned his/her blog, It's hard to take the content seriously no matter how good it is.

Jeff Atwood on June 24, 2005 7:46 PM

Interesting. I noticed the same thing about bicycles in Berkeley (on the campus). I would notice that a bike was in the same place day after day, and it remained untouched. After a week or two, I would notice that one of the wheels had been stolen. After that, the bike had about 3 days before it was stripped down to the frame. (Sometimes a wheel would be left as well if that wheel was locked up, but the wheel would be bent.)

David on January 13, 2006 11:00 AM

I think this works in reverse, too - I call it the Disney World Effect. The place is so clean, so perfect, that nobody would dare litter. You'll see people walk across the street to throw away the tiniest piece of trash.

Few people want to be the first person to mess something up. But if the application is already hopelessly packed with bad and incomplete code, what's a little more going to hurt?

jim on July 7, 2006 4:36 AM

Do you think that this can be attested to people aren't tidy?

Ewaku on November 9, 2007 4:34 PM

If your windows are boarded up anyway, it's probably better to just have a wall.

Don't claim to include features and then tell the user they're not implemented yet. That's still a broken window.

WurdBendur on June 2, 2008 9:44 AM

+1 WurdBendur - Amen.

Mark Smith on June 3, 2008 3:25 AM

If this is meant to be an analogy to neglecting your personal blog,I understand and agree.
However,if it is attempting to show human actions in a broken window
scenario,reading this and writing this is a superficial diatribe which plainly is a waste of time

RuthE. on November 25, 2008 7:36 PM

my windonw has just been smashed. Bummer.

siking on March 1, 2009 9:09 AM
Content (c) 2009 Jeff Atwood. Logo image used with permission of the author. (c) 1993 Steven C. McConnell. All Rights Reserved.