Overcoming Coder’s Block
Sometimes I completely run out of answers. Other times I have too many answers. Either way, I end up staring stupidly at the screen achieving nothing (well, OK, reading blogs). Here are a few techniques I use to help get unstuck:
- Pros and Cons: when I have too many answers, I try to make it objective by drawing up the pros and cons and seeing where that takes me.
- Simplify: like a lot of developers, I can be prone to over-analyse when I am stuck on an issue for a while. So I remind myself to try simplifying the problem. Often by dropping a layer of flexibility the problem is a lot easier to solve. If I really need the flexibility, I can add it later when I have greater understanding.
- Take a Break: sometimes I’m just trying too hard, and need to step back. I work from home, so a short walk outside is a welcome break. Actually getting away from the computer relaxes the grey matter. The vitamin D doesn’t hurt either ? .
- Explain the Problem: very often I find that while I’m explaining the problem, I see it in a different way. If not, the input of another person usually throws a different perspective on the issue. If there’s nobody to bother immediately, just writing down an explanation can help.
- Switch Gears: this works when I’m getting frustrated by a lack of progress. By switching to a small, unrelated task, I can Get Something Done and develop some new momentum. This also serves as a break from the original problem.
- Write Some Tests: I don’t practice TDD all the time, but when I’m stuck trying to understand how things work, writing some tests first can be very illuminating. Having tests in place also gives gratifying feedback as I finally start to crack the underlying problem. I find this works best for really tough technical issues, where good test coverage is even more important than normal.
- Write Some Code: if I have a partial solution, even if I know it is ugly or inadequate, sometimes I’ll just plow ahead anyway. Actually working through a throwaway implementation is better than standing still, as it turns up all the little details. I’m happy to throw that code away since I know the alternative was not getting anywhere.
So, should you be reading this, or taking a walk..? ?
This entry was posted on Wednesday, February 18th, 2009 at 6:30 am and is filed under Opinion, Technology. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

February 18th, 2009 at 7:06 am
a little madness » Overcoming Coder’s Block : BEC Development Blog says:[…] Excerpt from: a little madness » Overcoming Coder’s Block […]
February 18th, 2009 at 9:07 am
Vitamin D? Damn lucky round these parts at this time of year! ? Better off getting some pills and staying at your desk. Or just go out for a pint to drown your sunless sorrows. (Or have you left this cold, dark isle?)
Another solution, a quitter’s solution some may say, is to give the problem to someone else and wish them luck with it. If you care about the problem give it to someone smart who could take it on in a completely different (and, perhaps, more successful) way. I’d never vote for quitting outright, but may not feel ashamed to pass the problem on and get on with being productive. (If only we always had that option!)
February 18th, 2009 at 8:06 pm
Hey Yvan, c’mon, the temperature broke double figures yesterday! ?
Oh — and giving the problem to someone us is an idea I should probably try. I’m probably too stubborn to fully let it go, though, which I can pass off as being too nice to fully inflict it on someone else ;).