Attitude when working with legacy code
Itโs exhausting to work on a legacy project, frustration is natural when there are no people around that wrote that code, not tests, no documentation. BUTโฆ
Moaning, complaining and cursing wonโt make you life easier or better. If you want thing to be better, do something about it instead.
Try to understand the code and make it better, applying Boy Scout rule of making it better than how we found it.
Donโt focus on a big ball of mud as a whole, but focus on the small parts instead, and gradually make it better: write tests, extract methods and classes, rename variables etc. Itโs provides a rewarding experience.
You can treat it like a big jigsaw puzzle, that you are solving bit by bit.
Working with legacy code is not worse than working on a greenfield project, itโs just a different kind of problem, and can be interesting in its own way: are you good enough to make it better?
At the end of the day, it does not matter if we are working on a green- or brown-field project. Itโs our attitude toward our job that will make it more or less enjoyable.