DEV Community

Ido Shamun
Ido Shamun

Posted on

How do you go back to legacy code?

It's so fun working on a greenfield project, you can choose whatever stack you desire, you always learn new things. But then comes a time when you have to go back to your legacy code and you just miss this new stack you used before. I always want to refactor everything 🤣 How do you overcome this feeling when going back to legacy project?

Top comments (3)

Collapse
 
juststevemcd profile image
Steve McDougall

I tend to approach it in segments, sneakily refactoring little pieces at a time until my frustrations disappear.

Alternatively, spend free time working on a better stack as an outlet will also help

Collapse
 
idoshamun profile image
Ido Shamun

I find this "segments" technique one of the most difficult things to do as a developer. Especially if it involves database or infrastructure but I love it as well :)

Collapse
 
juststevemcd profile image
Steve McDougall

On of the best thing to do when it comes to refactoring a legacy product, is to add an abstraction layer in front of it and push the calls forwards (when it's an API).

If it's a full stack application it's much harder! It also depends on the language. A powerful IDE is your friend in most scenarios