Breaking Out Of a Programmers Block

Your cursor is still flashing at the same point and you have been staring at your screen blankly for over ten minutes. You make any excuse to get away from programming, “I’ll go make one more coffee” you tell yourself. When you start writing code you only delete it to start over again. If you are experiencing this level of procrastination then you may have programmers block.

Writer’s block or mental block is widely accepted in most creative fields. However programmers block does not seem to be as readily accepted. While they appear superficially similar they are very different things.

Generally most people accept that sometimes you can be stuck on a hard problem that you can’t seem to solve. A programmers block is something different. It is not that you are not able to solve the problem. The problem is that you find it very difficult to muster the will to want to program or to solve the solution.

It is difficult to say what the root causes are as not everyone is impacted in the same way. However I’m picking on three causes I have heard about that could trigger a block. The first is what some call “Analysis Paralysis”, the second is loss of confidence and the third is becoming lost in the details.

Analysis paralysis happens when having to consider too many competing solutions to a given problem. All of the solutions are poor with no real winner. A mental block sets in as a result of having to pick a solution from a set of bad ones.

Failures will usually knock your confidence, once your confidence is shaken it can be very hard to motivate yourself again. This can becomes more acute when multiple failures occur one after another. Perhaps a block is a natural defence mechanism from having to face yet another failure?

The more involved and engrossed you become on a particular problem, sometimes you end up losing yourself in the small details. You are unable to see the “bigger” picture. Those small details end up using up all your energy and it can feel like your project has run aground as it stops moving forward. The lack of progress against a looming deadline puts stress and pressure until you get into a mental block.

So if you find yourself in the midst of a programmers block what can you do to try and break out of it?

I would like to say that some magical “one size fits all” solution exists, but the reality is that different things work for different people. With this in mind there is no harm in at least giving the following methods a go.

Start refactoring some old unrelated code. You need a way to break away mentally from what you are trapped inside. Refactoring old code might help “warm” you up to programming again. The main thing is to get writing code again.

Talk to someone about the problem. Sometimes we can create problems that don’t actually exist. Discussions may throw up a different perspective that you have not considered. As an alternative get someone else to program this part of the system. This may feel like a cop out but against deadlines, it is better to lose the battle then the war.

Stop programming and go do anything that is not programming altogether. This may sound counter-intuitive, but forcing your mind against a task that you are struggling with could make things worse. A mental context switch might just be the break that your brain needs.


Next time you find yourself in a programmers block why not give some of the above ideas a go? Anything that might improve the situation should be at least tried. Having said this, one important aspect that should be noted is that programmers block can also be an early sign of burnout.

It would be really interesting to hear about different approaches to breaking out of a mental block. Have you had programmers block and if so how have you dealt with it?

Until next Monday, “stay calm and keep programming.”