Programming is often a very pleasant activity.<p>However, there are times this is not true, we as programmers usually get stuck with something that is complicated to solve.<p>That might be a bug, a non-trivial problem that we need to solve, or whatever it might be that we cannot solve quickly.<p>How do you deal with the stress though?
If it weren't for that stress, I wouldn't be a programmer. It is that variability, and challenge that keeps me coming back and satiates my desire to problem solve. But I understand, in the moment, it is hard to step back and see programming this way.<p>The only thing I do when feeling stressed, is to physically step back. I walk away from the computer, go on on a run, or get some sleep.<p>It is often within this absence that the solution to my programming problem emerges.
What your describing is the best part for me.
Obviously spending days languishing in confused and lonely impotence is horrible, but no job (in my experience so far) has the same high of going from producing nothing (ie. program doesnt work at all) to producing a perfect working product in one second, one line, one moment of insight.<p>As I get more experienced I get stuck or encounter problems less and less, I think I just keep doing more challenging or unfamiliar work in order to keep chasing that high.
I usually nap. More often than not, I wake up with a solution. Check this link for a good napping procedure <a href="http://www.artofmanliness.com/2015/02/18/hypnagogic-nap/" rel="nofollow">http://www.artofmanliness.com/2015/02/18/hypnagogic-nap/</a>
I deal with it with an old trick.<p>(1) Backing away. Pushing through stressed produces inferior results.<p>(2) Using a different constraint. That's the real trick.<p>Only I can't make myself pick the right constraint from the get go if I'm feeling stressed, so I stay stuck in a loop. I need to back away for the subconscious to reveal the right constraint.<p>It's as if I have to give up first. It seems it's only then I finally let myself attempt a solution I haven't tried before.<p>So ironically the way to deal with the stress of getting stuck and having deadlines is to manage to reach the point where, after trying everything, you sincerely no longer give a damn.
Some of you guys are misunderstanding me, I also enjoy the challenge of solving real problems.<p>But mix that with the pressure from your employer and deadlines and you get even more stress.<p>This is what I'm referring to.<p>How do you deal with that?
I like to talk about the problem with other engineers. It sometimes feels like you learn everything the hard way but it usually turns out that's how it is for everyone.