The leading psychologist of creativity, Mihaly Csikszentmihalyi, has long argued that creative activities such as writing, playing music, computer programming, mountain climbing, and chess playing are major sources of enjoyment and productivity. Such activities, he says, put us in a state of “flow,” or intense, unfettered focus and concentration. The beauty of this state is that we can have fun and be productive. The most creative people tend to fluctuate between intense interaction and intense concentration. They also tend to be the happiest when engaging in a state of flow.
That’s an excerpt from Richard Florida’s Who’s Your City. I’d never considered programming to be on par with mountain climbing, or even chess, really, but it makes sense: programming is really just problem solving. It requires absolute focus and a particular mindset to solve the problem of translating the vision for your project into code that the computer will understand and interpret as you intend.