

Ask HN: what creative methods do you use to solve programming problems? - corinamackay

I've talked to a few programmers who have interesting methods for encouraging their subconscious to take over when they hit a frustrating problem (eg: taking a walk, a bathroom break or playing Farmville). Do you have an interesting method you use for this?
======
just2n
I usually switch into a different task. That tends to work pretty well, and
doesn't leave me feel like I'm not making progress.

When I'm completely stumped or frustrated with something, I'll shut everything
off for a while. I just go do something. Enjoy dinner, watch TV, play games,
hang out with people. Zero thoughts about the problem.

Most of the time, re-approaching after a cold boot like that tends to change
my perspective so much that I will typically solve the problem with much less
effort than I expected would be required. Sometimes this is just caused by
being tired when initially approaching a problem and then conquering it after
resting. Sometimes I'll suddenly have a realization subconsciously and I'll
realize I figured out a solution to the problem without thinking about it.

This has worked for me since college. Getting one of those nasty algebra or
functional analysis problems and being stuck, then realizing in the middle of
playing a game later that you suddenly know how to solve the problem is a
great feeling. It's like you're doing work without doing work.

~~~
Iterated
I do this as well. It's funny when you've struggled with a problem for an hour
or so the day before and then the next day you sit down and figure it out in
10 minutes.

------
gee_totes
This is a form of rubber-ducking, but I write a question about my problem on
Stack Overflow. Often times, I figure out the answer before I finish writing
the question.

~~~
Iterated
I definitely have more posts where this happens and I delete it than actual
posts. It works great.

------
flexxaeon
I'm definitely in the taking a walk bunch. Seems like most of my frustrating
problems are just a case of looking too hard. I'll get up and (try to) do
something completely unrelated like turn on the TV or sit outside, then
suddenly the answer comes to me.

When I run into an issue during some late night ooding, the solution is always
sleep. Next morning, the answer will come to me a little after I wake up (when
the mind is most clear).

------
webdisrupt
Sleeping on it is the best solution at least in my opinion. However if you are
stubborn like I am and just want to fix the issue, then you would just hit the
vending machine and start throwing coins at it. Finally you get to indulge
yourself into a great number of chocolates to relieve the stress.

------
peachananr
Leave your computer for a day. Go outside, enjoy life, and disconnect from
your work. Worked every time for me.

If I still couldn't find a solution, I will eventually come up with a
workaround during those disconnected times.

------
peripetylabs
Writing things down or drawing on paper has always helped me.

------
corinamackay
Thanks for all the comments! Seems like most people have a similar solution -
doing something completely unrelated to give your brain a rest.

------
tjbiddle
Take a walk, jump in the shower, working on something else that needs to be
done, and last but not least - reach for the booze.

------
limeblack
Stand on my hand. It helps to use a wall if do so.

------
yen223
I ask myself: What would Jon Skeet do?

