Friday, February 13, 2004 06:16 PM
Julian Bucknall writes: "You're faced with a blank editor page in your IDE and nothing comes. No brilliant connection from requirement to design, let alone to implementation. Just stuck. Why is this?". He goes on to suggest several reasons (and solutions), both technical and psychological.
I think Julian ignores an important factor: programming is creative work. As a programmer who's experienced may blocks in the past (and will probably experience them in the future), I can think of two reasons for programmer's block resulting directly from this factor.
1. You're working on too many things. Programming requires concentration. Programmers work best in a state of flow - deep, trans-like concentration. Many programmers refer to this state as the "zone". When you're in the zone, the hours just seem to pass by. The problem is that it takes a long time (at least fifteen minutes) of uninterrupted concentration to get into that state, and an instant to get out of it.
When you're working on many unrelated tasks, each tasks can interrupt your flow. Switching tasks requires regaining flow for each new task. The process is not only time-consuming, but can also be exhausting. The more tasks you have, the harder it is to switch. If you switch too many times, you may get blocked.
One way to minimize this effect is by grouping related tasks. You can switch between similar tasks without breaking your concentration. Stay in the zone for as long as possible, and it will be easier to get back in the zone the next time.
2. You can't force creativity. A certain amount of creativity is required by almost any programming task. Unfortunately, creativity can't be forced. If you're not feeling creative, do something else. Find a smaller problem. Break your task into smaller tasks. Or just take a break - go for a walk, read something, go out for a beer. Forcing creativity is an exercise in futility - it just adds frustration, which usually isn't good for creativity.
Sometimes just forgetting about the problem and turning your mind to other things is the best course of action. Of course, you can't do this every time. Self-discipline and hard work can actually increase creativity, when done properly. If taking a break didn't help, start working, taking small steps. Get some work done - you may throw it out later, but it will get you started.