Jens Schauder is software developer since 1997. He loves software development for the constant challenges and constantly changing environment. A great chance to learn and teach. He is also blogger, author of various articles and speaker at conferences. Jens is a DZone MVB and is not an employee of DZone and has posted 84 posts at DZone. You can read more from them at their website. View Full User Profile

Honor Your Legacy Code

09.18.2011
| 3776 views |
  • submit to reddit

Many of us groan when they have to deal with legacy code. Especially those among us who fancy themselves to be craftsmen or clean coders often complain about long convoluted classes and methods, no tests and a tangle of dependencies.

I wrote before that you should shy away from the temptation to rewrite a legacy project. Today I’ll go even further:

Be grateful for the code no matter how messy it is!

If you have to work with this piece of code it is a strong indication that it does something usefull.

Actually everything we do depends on legacy code.

Your operating system: legacy (yes even the nice fruity one)

Your IDE: full of legacy code

Your Continuous Integration system: mostly legacy

Your Application Server: nothing but legacy

So the next time you encounter legacy code: stop swearing. Relax. Think of all the things it does for you and your boss or customer. Thank the creators for this.

Then concentrate on the thing it doesn’t do or does wrongly and fix it in a nice and clean way.

From http://blog.schauderhaft.de/2011/09/11/honor-your-legacy-code/

Published at DZone with permission of Jens Schauder, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)