A typical bad day at work for a programmer is to getting stuck. A stuck programmer is easy to spot, s/he is the one who has not moved away from the computer for a long time and if at all moves away is still visibly occupied with thoughts about how to find a solution.
Some of the solutions which I observed are
Discuss the problem with someone else
This is one of the best solutions which always worked for me. Even at times when someone listens to the problem does not help me fix it, just explaining it to someone helped me visualize and articulate better which in turn brought me closer to the solution. This is where pair programming wins hands down.
Read the Manual
While this may sound obvious, I have observed this to be one of the key issues to someone getting stuck. The entire IT population is trying riding on the keywords like convention over configurations, intuitive code, fluent interfaces; that combined with the hello world kind of exposure to tools gives programmers a more than enough confidence to carry on the everyday work. So when getting stuck the immediate response is to try what is obvious or what looks intuitive.
Take your eyes and mind of the problem
Any person’s action at work will first be governed by the conscience and instincts take over later. It is very similar to how we start driving or play instruments, we will be at ease once we are in a productive rhythm. The advantage of this mode where the instincts control our work is that it is very efficient but at the same time it moves us into a very narrow view of the work. When stuck we are stuck just in this narrow view and might not think out of this view (is it sounding like thinking out of the box?). This is similar to sleeping, it is so easy to get back to sleep when the alarm rings in the early morning no matter how difficult it was to fall asleep; if the concentration levels at work has been high and we got stuck then a way out is to come wide awake out of the concentration. Few times I have been stuck at programming from 6PM till bedtime just to wake in the morning and solve that in 15 minutes.
Almost every one of us at the work place have signed up for some sort of deadline, if we get stuck it adds to the stress. We have to use the phrase from “The Hitchhiker’s Guide to the Galaxy“. DONT PANIC