Whenever I talk about broken windows with respect to software development, I find myself directing people to this page. It’s an excerpt from the book The Pragmatic Programmer, which I’d definitely recommend checking out.
I like this link because it makes a pair of great points:
- Badness invites badness. A little bit of ugliness can quickly lead to the mindset of “All the rest of this code is crap, I’ll just follow suit.”
- Clean code encourages good habits. Nobody wants to be the one who introduces icky code.
So what’s the takeaway? First, you should always strive to create good, clean code. Second, and perhaps more importantly, apply the if-you-see-a-piece-of-garbage-pick-it-up principle. It’s much easier to clean up small messes now than it will be to deal with big messes later.