Skip to content
Gun.io
Pair of glasses sitting on top of a pad of paper with balls of paper in the background.
December 14, 2022 · 4 min read

Tackling programmer’s block

We’ve all been there: you’re staring at lines and lines of letters, numbers, and punctuation marks, wondering where it all went wrong. Wondering why a single good idea won’t grace your brainwaves with its presence. Wondering why you’re the one suffering from programmer’s block. Let’s get unstuck together.

This block is obviously not specific to just writers, or writers of code. No matter what your job function is, there are some days when the right thing, the one idea you need to solve your biggest problem, just won’t materialize. You’ve tried the big things, the small things, and the overwhelming things and, in the end, you’re still right where you began. So how do you get over that proverbial hump and put out the work you know is your best? Sometimes it’s as simple as leaving it in the rearview for a few.

What causes programmer’s block?

There are three main causes of most “blocks”: too few ideas, too many ideas, and competing ideas. With too few ideas, you feel limited in the moves you can make. Too many ideas can feel too overwhelming to make a move at all. And competing ideas try to pull you in opposing directions, unsure of which way is the right way. And all of these feel equally awful when you’re up against a deadline. 

How can I combat programmer’s block?

The tendency to stare at the computer or send yourself down a StackOverflow rabbithole of epic proportions are usually the go-to when getting stuck. Let’s look at ways to climb out, reset, and get you back on track.

Put a pen to paper

Admittedly, this has always been my go-to for a few reasons. One, I was a writer before I was a programmer, and seeing ideas on paper has always been a good way to sort out my thoughts. And two, I am a luddite at heart, and will always use a paper and pen before committing to using a digital solution (my collection of Moleskine planners can attest to this). But by virtue of forcing yourself to actually write what your problem is instead of typing it, you have to slow down and give more attention to the task at hand. Maybe it’s drawing out the framework, or perhaps seeing exactly how many divs you’re trying to use that will spark the right idea? Whatever the case, it’s a low-stakes approach to unblocking your brain.

Find a fun CodePen challenge

Speaking of pens, why not work on a coding problem that is purely for fun? CodePen has tons of great challenges that pop up, plus you can browse projects other people are working on, copy the pen, and add your own flair to it. Yes, this is a little bit like fighting fire with fire, but maybe what you need to break out of your rut is watching some CSS rain fall down your screen. And then turning those raindrops green, while you add in some neon pink clouds in the background. 

See the Pen cpc-rain challenge – Renewal by Colton Allen (@Colt4D5) on CodePen.

Walk away from your computer

Seriously. Get up. Walk away. Walk around your house. Walk your dog. Head to the gym and walk nowhere on a treadmill. Because humans naturally swing their arms opposite the moving foot, walking helps to stimulate both sides of the brain at once. It also increases blood flow to your brain. You know, that thing you’ve been draining of its lifeforce by banging your head against a wall? It will thank you for taking it and the body it powers on a nice little walk. 

Get creative

Using code to solve complex problems is creative in its own way, but sometimes you need to channel your inner art class teacher and make something not computer related. Being creative is a great way to solve a different kind of problem. How will these paint colors look when mixed together? What cuts do I need to make in this wood to get the joint to line up correctly? This can help you foster an appreciation for finding different ways to approach the problem you’re facing in your code. 

Do something physical

Regardless of how “stuck” you feel, getting up and doing something physical when you sit in an office chair for hours on end is always a good idea. This can be as simple as checking a few to-dos off of your household chore list, like sweeping and taking out the trash. It can be as complex as taking your kayak out and maneuvering your way down a local river. Like walking, any movement you add to your day will increase blood flow to your brain, while getting out of your everyday work space can help good ideas pop into your head. 

Wrapping up

Everyone faces programmer’s block; it’s just going to happen. The sooner you can recognize how and when it’s affecting you and your performance, the faster you can stop what you’re doing, employ one of these techniques, and get back in action. Writing code is just solving problems, and sometimes problems are reluctant to be solved. When that happens, step away, move around, write it down, and eventually get back to work.