legacy

I met the legacy code for the first time after only doing new projects. No wonder it was hard to keep up with the flow of the code. And there was no one to maintain the code, so it was hard to ask someone why it was written like this. I didn’t understand, so I felt like I wanted to change it to a new code. Senior engineer who was next to me said:

Old code exists because it worked last year, last month, two weeks ago, and yesterday. Let that sink in. At the end of day, something that works makes the user happy.

If you have a new design or some new way of doing something, it better be superior to the old way. It should be as clear as night and day. Typically, new code will hide a lot of bugs. But sometimes it is in new features or even in refactored code - and still, it should be judged against the same high standards.

All projects require new code - and this is how projects grow up. Growth has to be done in moderation and with great care - this is how software must evolve. We can analogize software growth as mutation over time, with each commit as a particular "mutation". We choose the best ones at a time, easing growing pains.