I’m not sure how many of you have heard of the phrase “Broken window broken house” otherwise known as the “Broken Windows Theory”. As a Software Engineer, this phrase holds special meaning because it describes software entropy – a condition we try to avoid. However, I have also found the meaning of this phrase is applicable to our daily lives, especially regarding how habits and patterns can influence our productivity and effectiveness.

Let me begin by giving you a bit of a background behind this phrase. Its origin can be traced back to an article written by James Wilson and George Kelling which was later turned into a book Kelling wrote with Catherine Coles. The book was titled “Fixing broken windows: Restoring order and reducing crime in our communities”. It addresses the question why some buildings in an inner city are beautiful and clean whilst others are run down, dilapidated and derelict. They write:

“Consider a building with a few broken windows. If the windows are not repaired, the tendency is for vandals to break a few more windows. Eventually, they may even break into the building, and if it’s unoccupied, perhaps become squatters or light fires inside.”

“Or consider a sidewalk. Some litter accumulates. Soon, more litter accumulates. Eventually, people even start leaving bags of trash from take-out restaurants there or breaking into cars.”

These examples describe how a single broken window, if left unrepaired for an extended period of time, can cause the inhabitants to lose respect, pride and care in their surroundings. When one window is broken, another will follow, and another. In time, vandalism takes place, crime levels rise and eventually the effort and cost to fix the condition becomes insurmountable.

For software, the “Broken Windows Theory” describes how rapidly a piece of software can degrade into entropy or “spaghetti code”. When a developer sees poor design or writes bad code and doesn’t fix the problem immediately, it sets a precedence for more poor design and bad code. Given enough poor design and bad code, the effort and cost required to address the problem become too big and it is simply easier to continue perpetuating the problem rather than fixing it.

For example, a developer seeing a software component someone else has written does not have comments might think comments aren’t important, required or necessary for this project. So they don’t write any. After all, if nobody is doing it, why should they? This is a natural reaction. However, soon you’ll have a system with thousands upon thousands lines of code which do not have comments or documentation.

In another example, a developer while attempting to write a software component, searches for other components in the system to use as reference but sees they have been written poorly. Fixing these requires too much work, so instead the developer exacerbates the problem by copy and pasting bad code to complete their task.

The book continues by describing the strategy for avoiding the decay and entropy is to solve the problems when they are small. When a window is broken, fix it immediately. In software, if a developer sees poor design or bad code, they should address it immediately.

I’ve found the “Broken Windows Theory” applies to our personal lives just as well. It isn’t constrained to solving crime and software engineering. Consider the following:

If I left some paper on my desk instead of filing it away at the beginning of the week, I find by the end of the week, I have a messy desk. If I left my clothes on the floor instead of the closet or the dirty laundry basket, soon I have a messy room with clothes everywhere. If I procrastinated on a task today, say paying the electricity bill, I find I don’t ever get to it until the day it is due and all my other bills don’t get paid either. If I left a single plate after dinner unwashed in the sink, soon there’s a sink full of unwashed dishes!

Do you see the pattern here? Instead of filing the paper away, putting clothes in the right place, paying bills the moment they come up or washing the dishes when required, procrastination can cause us, even if only at a sub-conscious level, to lose respect, pride and care in our surroundings. One piece of paper not filed, leads to more. One clothing item on the floor, is followed by another. Heck, there’s already 10 dirty dishes in the sink, what’s one more?

To avoid this slippery spiralling decay and disorder in our personal lives, I find that developing good habits and sticking to positive patterns are essential. Fix the problems and address the issues as they arise. Don’t leave that paper unfiled. Put it away immediately. Instead of dropping the clothes on the floor, put in a little bit of effort now and place them in the laundry basket. If there are dirty dishes, wash them immediately.

This applies to our personal and professional goals in life as well. Whatever your goals are, be committed to it. Do not approach them half-heartedly. I know this takes discipline, but if that’s what it takes, then you’ve got to do it. For example, I have committed to waking up early and consistently and I do so everyday. Not just on weekdays, but weekends too. Sleeping in just once, sets a precedence for future sleep ins. So try to eliminate thoughts like “I’ve already slept in 4 times this week, what’s another time?”.

If leaving a single window broken leads to more broken windows, then not fixing a window sends a message that vandalism is tolerated. In summary, the moral of this story is “Don’t live with broken windows”. If there is something that needs to be done or fixed, do so as soon as possible. Don’t let the problem escalate to a point it becomes too difficult or costly to fix. When that happens, it just doesn’t get done.

For more information about the “Broken Windows Theory”, you may find the following resources helpful:

Related Posts

If you like this post or have comments you wish to share, please use the form below. Alternately, you may trackback from your site.

13 Responses to “Broken Windows Theory in software and your personal life”

  1. Greg Cerveny » Blog Archive » Broken Windows says:

    [...] Dave Cheong has a good post up on his blog about fixing broken windows. The theory is that when shit is busted, you can either fix it, or encourage more damage to happen.  This applies to buildings, code, or your personal life. [...]

  2. Tom says:

    There’s also some dispute on this:
    http://www.washingtonpost.com/wp-dyn/articles/A46381-2005Jan29.html?referrer=emailarticle

  3. Steve says:

    This strategy has to be balanced with the benefit of taking a fast, even if hackish, route to the goal. One always has to balance the cost and benefit across a set of goals. What you are doing is usually subordinate to a parent goal, or at least competes with other priorities.

    One way to do this is to consider usage patterns. The perfect solution may require N hours; the perfect solution for 95 percent of use cases, and a hacked-up solution for the other 5 percent, will take only N/10 hours. Well…..in many cases that’s a deal well worth taking.

    And none of this should discourage you from seeking more efficient ways of doing things. It may be that taking the time you would have spent filing papers immediately to devise a strategy to save time on filing, to eliminate the need for filing, or similar ideas, may be a much better use of your time. So instead of fastidiousness, instead of fixing a broken window immediately, it might sometimes be better to think about how to prevent broken windows.

    Architecture is about tradeoffs and balance, given the requirements. The broken-windows theory is a useful idea, but not the final word.

  4. Dave Cheong says:

    Thanks for taking the time to comment Steve and Tom.

    I totally agree with what you say Steve – that we sometimes need to assess what we’re doing so we can determine if they are indeed worth doing. If time is better spent looking at more efficient ways which lead to greater gains in the long term, then that’s the most sensible thing to do.

    I feel the “Broken windows theory” is a good interim solution. Some things cannot be further optimised, for the others, sometimes we don’t have the time at this moment to optimise, so applying the theory can prevent our lives from turning chaotic.

  5. my_sn says:

    it is always my choice to prioritise but it needs my will-power to make a habit of it.

    dan millma says it well with “I learned that we can do anything, but we can’t do everything.. at least not at the same time. So think of your priorities not in terms of what activities you do, but when you do them. Timing is everything.”

    the crux of the matter is :-
    1) Do it today.
    2) Tomorrow will be today tomorrow

    i was taught that “procrastination is the thief of time” but if it weren’t for the last minute, I wouldn’t get anything done just the same ;) .

  6. Ryan says:

    David:

    This article is so true. I’ve found that many aspects of pragmatic development can be applied to general life. Very good article!

    Ryan

  7. Dave Cheong says:

    Hi Ryan,

    Thanks for dropping by and leaving a comment.

    Recently, I’ve found so many instances of the Broken Window Theory in my daily life, that it has reinforced my belief in it to a whole new level. As a conscious choice, I now try to prevent things from escalating to a point they become too difficult to resolve.

    dave

  8. Dee says:

    This theory makes lot of sense. Unfortunately the Washington Post that Tom refers to is racist and should be jettisoned.

  9. Noah Hornberger says:

    Well, for software this makes lots of sense, but I must critique your application to my home life as a reader. You use examples of chores that must be done in the home that if not done at once, will collect into larger jobs. Some people prefer to carry out life’s work by splitting it into smaller tasks while others prefer large projects. Some want to avoid large “messes” and some want to avoid “redundancy”. Your illustration of dishes collecting in the sink only works if your reader would be annoyed by such a thing, some people (myself included) would find it obnoxious to stop and take care of every dish instead of carrying on with more important matters. The rest of the article has sound logic, however, this point is very specific to the Type A personality.

  10. Dave Cheong says:

    Hi Noah,

    Thanks for the comment and you make a valid observation.

    I guess the argument applies most strongly to things that bug you. If you’re not bugged by the fact there are dishes unwashed, then it doesn’t make much difference washing one plate at a time or a sinkful.

    However, if it did bug you, the BW theory is very much applicable. If you really wanted to clear them and you don’t generally like washing up, then it may make more sense to tackle the problem whilst it is small.

    The same could be said for software development — if fixing the little things you observe as wrong is not as important as meeting your next deadline or releasing the next whizzbang feature, then it doesn’t make sense to fix them. However if you are at least concerned with the quality of the software (or your standard of living), then yeah, in that case apply the BW theory.

    Thanks for dropping by.

    dave

  11. Fight Procrastination! says:

    [...] Do it now: Don’t let the Broken Windows Theory eventuate. Take on problems early and often, before they get too big and too hard to overcome. [...]

  12. The definition of hardwork says:

    I define haredwork as ” an easy work not done well in time” is called hard work.

  13. buddy says:

    oh man, that makes so much sense! i’m very much a “what’s one more dish in the sink?” kind of guy. i hate dirtying a clean house. so yeah. good point. i know you’re just passing information along from one source to the next, but i’m glad you did, good stuff here man.

Leave a Reply