

Ask HN: How do you deal with the pain of programming? - grover_hartmann

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?
======
DarkTree
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.

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.

It is often within this absence that the solution to my programming problem
emerges.

~~~
grover_hartmann
I understand, but combine stress with pressure from your employer, deadlines
and such.

And then you get real stress.

That's what I'm referring to, how do you deal with that?

I'm not saying I don't enjoy challenges of solving real problems with
programming, I do enjoy them.

~~~
mayoff
Why do you think you need to deal with it any differently as a programmer than
you would in any other office/desk job?

~~~
grover_hartmann
I don't need to deal with it. I asked how most of you deal with it.

------
michaelmcmillan
I use TDD. No matter how complicated the task may be, I have found writing
tests first really reduces stress.

~~~
jpsilvashy1
According to your blog, you discovered TDD less than a year ago.

~~~
michaelmcmillan
I fail to see your point.

------
everyone
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.

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.

~~~
everyone
Also if I have to do an unknown unknown which could result in getting stuck
for a while I will schedule loads and loads of time for it. Like make a
reasonable estimate and then double it. Then it often turns out that you solve
it in a fraction of the alloted time and you feel awesome! Definitely dont
compound the stress by adding time pressure if at all possible.

------
meierjo
I usually nap. More often than not, I wake up with a solution. Check this link
for a good napping procedure
[http://www.artofmanliness.com/2015/02/18/hypnagogic-
nap/](http://www.artofmanliness.com/2015/02/18/hypnagogic-nap/)

------
gull
I deal with it with an old trick.

(1) Backing away. Pushing through stressed produces inferior results.

(2) Using a different constraint. That's the real trick.

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.

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.

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.

------
grover_hartmann
Some of you guys are misunderstanding me, I also enjoy the challenge of
solving real problems.

But mix that with the pressure from your employer and deadlines and you get
even more stress.

This is what I'm referring to.

How do you deal with that?

~~~
everyone
That seems like a problem of your employer imo. If they understand software
development they'll know that blockers and problems habitually crop up and
should be expected and timetabled for. Putting on pressure to get stuff done
hastily or creating artificial deadlines will just make things much worse +
create a load of technical debt for later. In my experience manager types who
have little or no experience actualy building stuff themselves think this is a
good idea, 'they must be goofing off I'll, light a fire under them!'

From the simpsons... Hank Scorpio: I'm gonna leave everything to you. We're on
a tight schedule. You keep them motivated. [he leaves] [his staff is busily
working] Homer: [to staff] Are you guys working? Man 1: Yes, sir, Mr. Simpson.
Homer: Could you, um... work any harder than this? Man 2: Sure thing, boss.
[they do]

Also relevant if your self-employed. In that case you must not be creating
realistic schedules for yourself.

If I'm doing some project with a hard _real_ deadline say, 3 months away. I'll
arrange my timetable to have everything completely finished at least a week
early cus I know, something or other will crop up at end end.

In conclusion perhaps scheduling/planning/timetabling issues are the route
cause here. If you arent self employed you should definitely bring this up
with your employer. If they are even halfway decent they should take this very
seriously.

ps. I've only been working in software for a few years now but I have a good
few years of experience working as an architect (building buildings)
Architecture is all about project management and stuff _always_ goes wrong! +
If you delay the project everyone sues your ass off!!

------
aplummer
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.

------
jordsmi
The joy of fixing the bug/creating a solution for a non-trivial problem is
enough for me.

------
koberstein
The complicated problems are not the pain to me. The trivial things are the
pain.

~~~
grover_hartmann
That's not what I asked, see my other replies.

