This question already has an answer here:
I recently signed on to a contract where I am supporting an aging legacy system. The system is a collage of .net and VBScript components. Part of it operates as a web application; part of it operates as a Windows Service.
As anyone on this site can tell you, it is possible to write great code with legacy technology and it is possible to write terrible code in new technology. The project I'm working on is some of the worst spaghetti code I've ever seen. It is over ten years old, and has been developed, supported, and maintained by a half-dozen unrelated companies. There are few code comments, and it's like each developer didn't know what the previous developer was doing. Yet somehow, the program works most of the time and is a critical part of a big business.
There are hundreds of thousands of lines of code in the system, and here's how it works: Each week, my client gives me several bug reports to review at the beginning of the week. I am told specifically not to try to improve the design of the system, but to make the smallest change possible to fix each bug.
Here is what bothers me:
First of all, it is very taxing just to try to read the code and discern what it does. There are iframes galore and very odd ways of interfacing browser to server and server to DB. It is common for to take days to find the corner of the codebase where a bug is caused, and if the fix isn't trivial, it can take days more to understand the related parts of the codebase.
It feels like pushing a rock up a hill for a living. The work is very exhausting mentally. It is difficult to maintain focus, and then I feel additionally stressed by wanting to perform my best while being tired and unfocused. To top it all off, I know the whole time that I am working on a bug that as soon as it's done, I am to start all over with another bug.
The work is very remunerative and I would like to fit myself better to it.
How do some of the more experienced developers handle this sort of stress?
Edit: I think that Robert Harvey brought up a good point in the comments below: that I could be stressing myself with my own expectations. Much of my past experience has been with green-field development, so perhaps the slower pace of maintenance. Perhaps this maintenance requires a different mindset and way of thinking.
Also, I take great exception to the idea that I'm inappropriately asking for help with my mental health. I do understand that psychiatry is now considered a medical discipline, but that doesn't mean that any and all questions about managing stress and being happy should be handled only by mental health professionals. That's just silly.