I hear developers complain regularly about some ugly, confusing ball of mud code base that they have to slog through and try to support. If they could just rewrite it from scratch, they say, it would be so much better! I have two observations about this:
First: Why do you think that big ugly mess is still being used? It does something important for the company. And most of the time it does it correctly. It provides value. Very few companies can take the risk of throwing out a working system in the hopes that another, newer system will, after months – or years – of investment do the same thing the original application did!
I’ve heard of it happening, but only in industries that can afford that kind of investment, and only with an elite, proven development team with excellent communication skills. Hothead prima donnas need not apply.
Second: How do you think the code got to be this way in the first place? A little bit at a time. The original author took some shortcuts that they intended to go back and fix, but never got the chance. Someone went in to change things and followed the pattern of the original author. Others followed suit and, over the years shortcuts accumulated, bad coding habits became the norm, and since it continued to work, no one really complained. Until it got to be too hard to maintain.
But what is at the bottom of these bad programming habits? Respect.
A development team where the developers have respect for one another – and for themselves – will do their best to make sure the code is maintainable and extensible. If I respect myself, I would never let my name be attached to a piece of code that was hard to maintain without clearly indicating that it is so, and that I intend to fix it.
If I respect my career, I will work to keep my knowledge and skills current. I will make sure I use the tools I need to do my job well – whether or not my employer provides them for me.
If I respect the developers who follow me in maintaining a code base, I will make sure the code is readable, extensible, and maintainable. One of those developers will likely be me!
The Boy Scouts have a rule: Always leave a campground in better condition than you found it. They do this out of respect for the land, respect for their fellow scouts, and respect for themselves.
This idea should also be applied to developers and their code – always leave your code better than you found it.

