DEV Community

Discussion on: Legacies Never Die: How to Handle Legacy Code

salmanbabri profile image

There is a book called "Working Effectively with Legacy Code" dealing with the same topic. It is a fantastic read, and I would recommend devs who encounter a legacy codebase to check it out.

One of the core ideas about a code being legacy is that it is not covered by unit tests. So if you are writing code without unit tests today, then you're effectively writing legacy code from the get-go.

I do understand that sometimes due to time constraints devs have to write dirty code. But more often than not, I've seen devs casually scoff at the idea of following software design guidelines, writing tests etc. And I think it is justified if later on, someone criticizes their code due to the author's negligence in the first place.