Does the Zone Exist?

Monday, 05 August 2002

Recently, I was sitting at a desk at work, minding my own business, concentrating on a specification. I was trying to resolve a thorny issue and had achieved almost perfect focus; I was also wearing headphones which screened out minor distractions. The music started to do its work, and I found myself starting to understand what the problem was. It's very nice when something that resists resolution seems to start coming together; you don't want to stop until the process is over and the problem has opened itself to you.

I was tapped on the shoulder and jerked back into normal space abruptly. I turned around, yanking my headphone jack out of the PC, and was immediately engaged in conversation; I couldn't even understand what I was being told to begin with because my head was still in the specification. A minute or two later, it was all over and I was back facing the monitor. This apparently harmless interruption had derailed my train of thought completely and I'd estimate it took around 10 minutes to return to get it back on track. This time cost someone money. Is this my fault?

The other Joel has spoken about the importance of getting programmers "in the zone" where they can do some good. It's a state of mind where you are completely engrossed in the problem. I'm pretty sure most developers know about this one way or another. The many nights I've started coding a personal project, only to find that it's 4am already. I know what the time is, but I'm having so much fun, and conquering problems like there's no tomorrow (it already is tomorrow) and I can't make myself waste time on frivolous things like food or hygiene. This still happens to me, but it rarely happens at work.

Work is full of distractions. Whether it is e-mail, or phones, people requesting help or even the vending machine being restocked (it's not one of the quietest processes in the world). When the cleaning staff come around at 5.30pm pushing their vacuum cleaners under your feet you're not going to get mental focus of any quality. For any line of work, it's obvious that the ability to focus, get away from distractions is extremely important. Sometimes when I cannot break a problem, I disappear into a deserted meeting room and scribble the problem on the whiteboard. A quiet, sparse room by myself has never failed to break one of my desk deadlocks.

However, it is implied that development is a particularly sensitive discipline, what with all the logic and multiple structures floating around inside your head. The reason I ignored this is because when I crossed the fence from personal programming to corporate software development, I decided that I had to compromise on a number of things.

When you're producing code for someone else, the game changes. You are not an island programmer. Your code must be flexible, friendly and transparent. You can't work to your own deadlines, you have to work to someone else's (within reason of course, ho ho). You have to work on code other people have written and you are rarely coding something from scratch. Development standards may be imposed by a higher authority and you have no say. And of course, you have to deal with working in a team. Working in a team means being responsible, answering other people's queries, follow up problems, issue information to various individuals and so on. Suppose I go into work and say to everyone, "Hey everyone, I'm going in another room to work for 8 hours. I don't want to be disturbed!" This might come across as self-indulgent and irresponsible. What if someone needs my help? What about the latest discussions on client XYZ? And so on.

So slowly, I convinced myself that I didn't need to worry about the so-called zone. It was, I believed, simply an aspect of programming as an addictive hobby; like those people who play online role-playing games until they die of starvation. You can't do that at work. It's not allowed. It's not fair on the team.

Recently, though, I'm starting to wonder if that's a serious loss for any employer. Maybe programmers should be allowed to build castles where they won't be disturbed. I know the zone exists, so the question really is, "In a workplace, can the zone exist?" I don't know. My own experience suggests absolute focus pays great dividends so maybe it should be utilised in corporate environments to produce quality, robust software... but is this the whole story?

I hesitate at this point because the successful extreme programming (XP) model advocates the complete opposite. In XP, a development team is physically arranged to maximize contact. Any developer can talk to any other, as required. Developers work in pairs (pair programming) which seems to remove any possible hope of getting into the zone. The development paradigm is of true teamwork; maximum interaction, a collective if you will. Most developers baulk at the idea of being forced to program with other people like this, but those who have tried and been successful with XP cannot return to those mundane days where developers were expected to type alone.

I haven't tried XP and I'm not sure whether I'll get the chance to try it out any time in the near future. Moving your project team towards the XP approach is a project by itself. I will return to discuss XP later, in another article. However, it strikes me that XP may actually be a communal zone, and now this discussion on software development sounds like science fiction.

There appear to be benefits at either end of the spectrum; developer isolation and developer community. Right now, the only thing I can conclude is that both of these approaches suggest that developers should be allowed to write code without interference. Amen to that.

End