Sunday, January 08, 2012

Legacy Code and New Developers

I just read this article about legacy code, and I am dumbfounded.  The author seems to embody the attitude that nobody before him/her was a capable programmer.

(Warning, Old Fart Programmer Rant approaching...)
What new programmers forget is that the legacy code was written over many years with evolving needs.  The original schedule was probably a Death March, there have been 4 major OS version updates, 7 compiler migrations, and a database vendor change in those years.  The customers have made thousands of change requests, all of them urgent needing immediate fixes that have to be tested on the customer site because they have a configration that cannot be duplicated in-house in less than 2 weeks.

There have been 20+ developers working on this, some of them contractors with less interest in long-term maintainability, some of them fresh out of school, and most of them overworked.

One of the systems this code has to interact with is ancient and does not use a modern communications protocol, so you have to write raw socket code and parse proprietary binary streams - no well-defined XML with a DTD here, bucko!

There are no unit tests, because 1) this code was written before Agile was invented, and 2) the project managers are old-school, and testing is not part of their schedule, it's for the Test Group, so you can't waste time writing tests during Development, or you get fired.

So don't get all holier-than-thou about old code, laddy - your code will look like this someday. if it's still in use.