Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Legacy code - when to move on

Tags:

legacy

My team and support a large number of legacy applications all of which are currently functional but problematic to support and maintain. They all depend on code that the compiler manufacture has officially no support for.

So the question is should we leave the code as is, and risk a new compiler breaking our code, or should we bite the bullet and update all the code?

like image 269
mmmm Avatar asked Mar 21 '10 01:03

mmmm


People also ask

When should you rewrite software?

A piece of software is typically rewritten when one or more of the following apply: its source code is not available or is only available under an incompatible license. its code cannot be adapted to a new target platform. its existing code has become too difficult to handle and extend.

Should I refactor old code?

There are various benefits to careful refactoring legacy code. For starters: It makes code easy to understand: Refactoring code involves restructuring code in such a way that a new developer can work on it with minimal difficulties. When it's understandable, identifying and fixing bugs becomes effortless.


3 Answers

The answer is totally dependant on the resources your employer (or yourself) can afford to make the refactoring (or even totally rewrite big parts).

So you should first estimate how much time/developers you can afford to refactoring the application, then see if you think it'll be enough.

If you can afford time and people, then do it, don't hesitate! You're investing in the future by reducing the time to debug the application so it will be helpful and less expensive once the refactoring is done.

like image 74
Klaim Avatar answered Oct 03 '22 12:10

Klaim


It depends on the nature of the applications, just how big and important they are, as well as the programming culture at your workplace, and the resources available to you.

If the applications are valuable enough to you that they are worth the trouble, and you have the necessary resources, then do the update. Don't let the problem persist.

If they are not valuable enough to be worth a full-scale update effort, or appropriate resources are not at hand, perhaps work on updating one at a time if possible.

Just some suggestions, but again this greatly depends on you and your organization.

like image 41
Grant Palin Avatar answered Oct 03 '22 11:10

Grant Palin


It sounds like you have a large technical debt. This debt is only going to increase unless you do something. Both things you mentioned are options, and risky, but long term it's a risk you need to take.

Using an updated compiler just means you need to update the code to work in the new compiler. Something is bound to break, but then refactor the parts that break. This allows you to migrate.

The other option is to update your entire code base. This takes time, during which you need to maintain 2 copies of the code, or freeze the old version. Freezing the old version is probably not an option.

I would recommend using an updated compiler and fixing what breaks. This allows you to add features, while refactoring and fixing the current codebase.

like image 40
Brent Baisley Avatar answered Oct 03 '22 13:10

Brent Baisley