I started re-reading The Pragmatic Programmer over the weekend and one of the early chapters mentioned the broken window theory.
Google search the term, but the quick version is basically that studies were done by experts in crime and urban decay that something as small as one broken window in a building, left unfixed, will make people occupying a neighborhood feel as though no one cares about the neighborhood and things will go downhill from there. One study was done where a car was left in the same spot for weeks and nothing happpened to it. Then one day, the person conducting the study smashed the window and by the next day, the entire car had been stripped.
Ok, so how does this apply to software? Well - when a codebase contains a lot of un-clean code and generally looks as though it's been abandoned, the developers working on it are often more likely to use it as an excuse to do things the quick and dirty way. Why should I worry about making my code maintainable, when this codebase has duplication all over the place and functions/pages that haven't worked correctly in months.
On the flipside, if a codebase is nice, clean and easy to work with... developers will be LESS likely to go for the quick and dirty change because they won't want to be responsible for being the one to start the downfall.
The reason this hit me so hard this weekend while reading was on account of something that occurred during work on Friday. I came across an old file in my application that had a few validation functions in it. The only problem was, the entire body of the functions were commented out and all that was left was a "return true".
Now, this is hardly the biggest problem I've come across in this codebase since I started my job, but it was just another case where I could've seen it, felt hopeless and moved on. But what I decided to go was... fix them. Remove the functions that have been commented out for years and then clean up the code was calling on them only to set their values to true.
And that's basically what the chapter in The Pragmatic Programmer suggests. Fix Broken Windows. Because just like seeing decay will sway a fellow developer to continue the decay, seeing repair will push fellow developers to continue that effort towards a cleaner codebase.