Legacy Code: What to do About it

There are a lot of questions around legacy code. If we ask any developer who is new to the organization, they will most likely say: REFACTOR! Our first knee jerk reaction is to not touch the legacy code, so we kind of dismiss the new developer saying that. However, we should look more deeply at what they are saying.

The Code is Messy

Generally, when dealing with legacy code, it is messy! Let's face it, when we start writing code, we ignore certain design patterns for others because there isn't a need. Once we get large enough, something has to be done about it. We need to stay focussed. If we feel that we are assigning one senior developer to fix legacy code, while 50 others are still using it, we will,never fix the code. Continuous Confidence comes from looking at the code and feeling calm not erratic.

The Code is Antiquated

When we hear refactor, His might mean as well that the code doesn't follow today's standards. So how do we make it so? We need to refactor. That is OK Tom do. We need to focus on the most impactful things first and structure the code in such a way that we build confidence in what is happening is not going to bring things to its knees. Example: don't move every file in He code base into a different directory structure. Bad juju. Try modularizing and considering the impact of the code.

The Code is Hard to Understand

If we have confused developers, then we will have bugs. We will have far worse code produced that the legacy code is itself. If we continue to perpetuate problematic legacy code, we will slow down and confidence will wain. 

So please, when you can: cleanup the legacy code!

Comments

Popular posts from this blog

Not All CI Solutions Are Created Equal

Stop Talking About Continuous Integration