“Every game is composed of two parts, an outer game and an inner game. The outer game is played against an external opponent to overcome external obstacles, and to reach an external goal… [The inner game] takes place in the mind of the player, and it is played against such obstacles as lapses in concentration, nervousness, self-doubt, and self-condemnation.” — W. Timothy Gallwey, “The Inner Game of Tennis”

These words came into my life sometime in my tween years, not all that long after I had learned to move from “You’re ahead 3 points to 2” to the more refined, but totally inexplicable, “40-30” of competitive tennis. There were courts near my house and I played well enough to be a sparring partner, but I wasn’t very good. On realizing this, I tackled the problem as I did all others: by going to the public library and checking out an armful of books. With wistful certainty, I can tell you that reading books turns out not to be the surest route to Wimbledon.

But Gallwey’s book introduced me to the concepts that Mihaly Csikszentmihalyi later labeled “flow” or “flow state”: the time-erasing hyperfocus where challenges are perceived to be—not in balance with ability—but as just-achievable goals. Being a developer is being wrong 200 times per day, but when you’re in flow, those 200 mistakes are part of 400 mind-stretching triumphs. Your day, no matter what the clock or sun says, is barely started before it’s over.

Over the years, I’ve come to believe that flow, more than any other factor, determines productivity. What’s the difference in productivity between a good day and a bad day? There are the obvious time-sinks: meetings, bureaucratic paperwork and the like. But while some of those things may simply consume raw hours, for me, “bad days” are more often those that are characterized by frequent interruptions. I get frustrated by days when I’m stuck in meetings, but it’s the days when I can never “settle in” that drive me crazy.

In their classic book “Peopleware,” Timothy Lister and Tom DeMarco held that flow was important enough to merit ranking a workspace on its “E-Factor,” calculated as Uninterrupted Hours/Body Present Hours. That’s right: a single interruption per hour counts as a failure. It may be difficult to specify what counts as an interruption: a phone call, sure, but what about a phone ringing? An e-mail conversation, of course, but what about the chime of e-mail arriving or toast popping up on the side of the screen to the same effect? For people like me, used to working from a home office, the noise and activity of a coffee shop is irritating, and the chaos of an “open plan” office strikes me as a small step down from the third act of “Godzilla.”

To a certain extent, I’ll accept that my distaste for noisy environments has an element of both personal and generational preference. A 2012 study suggests that there is a sweet spot for ambient noise around 70dB that maximizes “creativity,” and the cathedrals of sport are generally a little more raucous than their spiritual counterparts. Even a tennis court is hardly a library, and I have no doubt that Formula One drivers, for instance, could teach even excellent programmers a thing or two about focus.

But who needs to debate external interruptions when we are so good at creating our own? Once upon a time, being distracted required you to put down your pencil and pick up a magazine, or to wander over to the water-cooler to find someone to chat with. Now, it’s difficult to not have distractions in the same browser in which you’re researching your work (I use Chrome’s “Users” capability to try to keep work and personal pages separate, and, if I can’t keep myself honest, will let Anti-Social lock out Twitter and the like).

In an article published in 1997, Csikszentmihalyi quotes studies showing people spent 4x as much time consuming passive entertainment rather than engaging in flow-based hobbies. He asked, “Why would we spend four times more of our free time doing something that has less than half the chance of making us feel good? Each of the flow-producing activities requires an initial investment of attention before it begins to be enjoyable. If a person is too tired, anxious, or lacks the discipline to overcome that initial obstacle, he or she will have to settle for something that, although less enjoyable, is more accessible.”

As with Gallwey’s “nervousness, self-doubt and self-condemnation,” Csikszentmihalyi’s tiredness, anxiety and lack of discipline are inevitable, no matter the talent level or experience. In programming, as with sports, flow is not achieved by routine; it doesn’t come from playing another game of perfect tic-tac-toe or writing a “sum” function. This is one of the great difficulties of managing excellent developers: Their hunger for new challenges is not merely a preference; it’s necessary for them to be excellent.

Flow, and the resultant high productivity, cannot be sustained indefinitely, hour after hour, day after day (much less month after month). The downside of this is that today’s 4x-er might be tomorrow’s median developer. The upside, though, is that if the conditions for flow can be increased, not only do managers get higher productivity, but developers get greater satisfaction.

Now don’t even get me started on golf.

Larry O’Brien, former Editor of Software Development and Computer Language magazines, is a software developer living in Hawaii.