"Legacy code" is often code that you want to replace because you don't understand it. The problem is, before you can replace it, you need to understand it, and, once you understand it, replacing it is rarely the cheapest option any more.

#SoftwareEngineering

@jbqueru I have heard it said that legacy code is code without tests. There are people pumping out legacy code right now
@flyingsaceur @jbqueru I fondly remember @samir saying after one of my Code Dojos "Now I see how people can write legacy software in twenty minutes!"
@sleepyfox @flyingsaceur @samir Yup. Legacy code is code for which the maintainers don't have enough understanding, and tests embody that understanding. So, indeed, it's possible to write code without thinking much about it, and, without test or documentation or comments, the knowledge fades away in extremely little time.
@jbqueru @flyingsaceur @samir I personally don't completely agree with Feather's simplistic definition, the truth is more multifaceted.
But code without tests is probably on the way to becoming legacy code, yes.

@sleepyfox @jbqueru @flyingsaceur I also have fond memories of that workshop. 😁

And I agree that “code without tests” is an interesting category of legacy code, but not even close to all of it. I have seen so much code with comprehensive test suites that was full of bugs and completely unmaintainable.