Writer’s block is a problem that writers have when they simply don’t know what words to put on the page. Developer’s have this same problem, I like to call it coder’s block. Where does it come from, and how do we get rid of it? Let’s dive in.
Where coder’s block comes from
My theory is that coder’s block is the result of burn out. When you are so close to your work for so long burnout becomes a serious problem. At first you will start to make “simple” mistakes more frequently, and eventually most things start to take longer to finish. This all builds on itself and starts to erode your self confidence in your work. Once your confidence is being questioned it is every easy for things to snowball to the point where you are afraid to write code for fear of it being another broken thing to fix. At this point you are deep in the throes of coder’s block. Nothing seems to work right, and it seems like it never will. The worst part of this is that most of the damage is self inflicted. I’ve found that a lot of developers are unnecessarily hard on themselves. If given the chance to stand back and look at the situation most would recognize that things really aren’t that bad.
How to battle coder’s block
Identifying coder’s block is definitely the first step in recovering from it. Once you realize that it is happening the first step is to stop and ask yourself how you got to this point. Maybe its a project where things are going well. Too many bugs are coming in, and there’s not enough people to work on it. We’ve all been there. Situations like that tend to silently spiral into worse and worse condition. The next step should be to take a small break. Even if its just a walk around the building, getting physically away from the problem helps so much. Getting up and walking around, or even better doing some exercise, can help distract your brain from the situation. This allows your subconsciousness to process things. Its not that this will suddenly allow you to see what code to write, rather this will allow your brain to decide what the best course of action is. For example: It could be that it is just a matter of re-prioritizing what you are working on so that you can tackle the root cause of the problems. Taking the small break to let those thoughts percolate can help boost your confidence by letting you think of a clever solution to your pain points. And isn’t that the best part of being a programmer? If the problems are bigger then it might be time for a break. When was the last time you took a vacation? When was the last time you went more than 24hrs without touching a computer? Now might be a good time to do that!
Sometimes we just get blocked and we either can’t take a long break due to deadlines, or there just doesn’t seem to be any root cause. In those cases I’d recommend trying out these ideas to see if they can break up the logjam that is causing the coder’s block.
- “What would this look like if it was awesome?” – This is an odd one that I’ve had a lot of success with. When I’m faced with code that is so ugly I’m scared to touch it, I’ll ask myself that question. It usually leads to some out-of-the-box thoughts that might not be the right or final answer, but usually lead me to something new and interesting.
- Learn a new language/framework – Sometimes we are just in a rut. Forcing your brain to tackle a new challenge can be really invigorating.
- Read some fiction (sci-fi specifically!) – I’ve been surprised by how motivating a good sci-fi story can be. Think about it, in those books the future is wide open and anything is possible. That is also true in our real lives, but sometimes it is hard to see. If you need a recommendation to get you started check out Accelerando. It is awesome and mindbending.
- Work in a different physical location – This is a timeless tip. A new environment will shift your mindset just enough to make you think a little different. Go find a coffee shop or some other location. Even if you get zero code written, just being out and about can help you so much.
What are some of your favorite ways to get around coder’s block?tags: