I mentioned in a previous entry that legacy code was a challenge here.
What is Legacy Code?
While Wikipedia defines it as being “source code that relates to a no-longer supported or manufactured operating system or other computer technology,” I see it as something broader, something like: non-robust, unmaintainable, passively maintained, or antiquated. For lack of a better term, I’m going to call it Legacy.
Legacy code is something you will find in any organization. The key difference you will find is the strategy for dealing with it. There are several non-mutually exclusive approaches:
- Triage and Containment
- Retirement
- Renewal
At Wharton, I have found all 3 strategies depending on the application. Before I delve deeper, I want to reiterate that this type of code exists everywhere and Wharton is not an exception. I have been guilty many times of creating code that I know will become legacy.
Triage and Containment
There are several apps that I have encountered that we are responsible for trouble shooting, fixing major issues, and handling user support, that we do not actively improve or modify. I think the primary reason is that these are relatively stable, and the primary authors have long since left in some form or another. Another reason is that we are often off working on the next big thing. I know that I would rather work on something new than work on an old application (especially not written by me). Often these apps run fine, but there are minor annoying bugs that could be fixed to make administrator or user experience much better. Sometimes these are apps that should never have been written in the first place. They replicate functionality existing in other apps. They do something that a paid for service might do better. The functionality they offer is offered out-of-the-box by an open-source application.
Retirement
Some apps have been marked for retirement–just as soon as something better comes along or people just stop it! Bugs are likely to go ignored unless mission critical. Very little effort is committed in terms of support and there is no thought about upgrades or even minor feature enhancements. These apps are unmaintainable and sometimes the authors never thought they’d be used more than once or longer than a couple weeks.
Improvement
What’s old is new again with this strategy. The app is frequently updated with bug fixes, new features, and support is responsive and quick. When there is a platform upgrade, these apps are the first to be tested and migrated. The only problem is that refactoring existing code is limited or absent. As time progresses, apps like this can become a huge drain on resources. No one is sure why things are the way they are, and since there is limited refactoring, things wills stay that way.
Documentation
When an application was designed and written, some combination of forces: lack of time, lack of desire, or lack of knowledge resulted in a system that lacks documentation. This is an indication that the code will become what I call Legacy. The challenge for us as developers, as we mature, should be to be mindful of the people that come after us, and how they will be able to use and improve the systems that we build.