Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by GlenH7, Thomas Owens Mar 22 at 10:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This question appears to be off-topic because it is about psychology and mental health. –  Robert Harvey Jan 29 at 16:30
programming specific part of the question is covered in I've inherited 200K lines of spaghetti code — what now? As for psychology and stress, it would not be wise to expect a professional medical advice here, this site as all tour professional programmers –  gnat Jan 29 at 16:31
In any case, it is spaghetti code because of the way they have asked you (and others) to maintain it. If that's what they want, then that's what they get. It doesn't sound like they're pressuring you to perform the work any faster, so I don't know why you feel stressed. Bad stress is caused by overwork, not by work. If what you're really saying is that you don't like the work, I can sympathize, but it is your choice. –  Robert Harvey Jan 29 at 16:32
I feel your pain and have been there too. A related answer that I think fits. programmers.stackexchange.com/questions/197650/… –  Mathew Foscarini Jan 29 at 16:46

1 Answer 1

Unfortunately, sometimes this happens.

My suggestion is to try to have a relaxing time when you are not working so that you go to work full of energy and more relaxed. I suggest doing one (or all) of these activities:

Running. Have any Questions?

Swimming. Have any Questions?

Going to the gym (for instance, to do strength training). Have any Questions?

Yoga. Have any Questions?

Dancing (for example, Salsa). Have any Questions?

I really hope the situation gets better.

EDIT Perhaps I was not clear: In my humble opinion, to be able to give the best of ourselves in our jobs, it helps to exercise because it reduces stress.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.