Should we rewrite all legacy software??

very often we talk about legacy systems. But when exactly does source code change into a legacy? Well, first thing to do is to see what wikipedia tells us:

"Legacy code is source code that relates to a no-longer supported or manufactured operating system or other computer technology. The term can also mean code inserted into modern software for the purpose of maintaining an older or previously supported feature — for example supporting a serial interface even though many modern systems don't have a serial port. It may also be in the form of supporting older file formats that may have been encoding in non-ASCII characters, such as EBCDIC." Source: Wikipedia

This definition gives us some better idea about legacy code. Nevertheless, it seems legacy code is something bad, something old, we have to maintain for one reason or the other. Should we try to get rid of legacy code? I think the answer to the question is, it depends. It usually is not a good idea to rewrite source code just for the sake of using a different technology to do the same job. So what could be drivers to do such an upgrade? (Did I just say upgrade? I meant to say change.... ;-))

Some examples for considering to rewrite parts (or all) of a legacy system could be:

  • New functional requirements that can not be, or are too expensive to be, fulfilled with the old implementation.
  • End of support for implementation technology.
  • New non functional requirements such as performance, scalability, and quality can not be, or are too expensive to be, fulfilled with the old implementation.
  • Maintenance of the code is extensive, and/or components that are not seen as business differentiate can be bought cheaper from 3rd party vendors in the same (or better) quality
  • Qualified resources for maintaining and extending the legacy parts are difficult to attract and/or to retain.
  • New implementation allows for product differentiation.
  • New components allow for higher and/or additional revenue streams.
  • Productivity and efficiency increase justifies the investment and offsets the risk associated.
  • ...

The provided list shows reasons when to consider to think about upgrading parts (or the entire) system. Nevertheless, it should be clear that the risk involved in rewriting legacy systems is high. The systems that are around for a while (which legacy systems usually are) are usually thoroughly tested, they usually provide predictable and high quality functionality for the functionality implemented. Therefore, I usually recommend to wrap legacy components (if it makes sense) to be easily accessed and extended by the state of the art technologies used to implement the "newer" systems. This enables to limit the risk of rewriting the working legacy components and allows to attract and retain talent to work with up to date technologies as well as to provide a UX that potentially can be a business differentiator.......

Technorati Tags: software,architecture,legacy,code,quality,