Every coder knows it - "The Zone", that magical period of time when the code seems to just flow -functionality slots into place, unit tests going green like christmas tree lights, widgets pop up on screens, or servers start to respond. Everything doing exactly what you want it to do, when you want it to do it. No fuss, no bother. Just working.
Usually you don't know when this is going to happen. It's not predictable, or schedulable, it has it's own mind on this. But you can feel it when you're there. In the movie "The Social Network" there are a number of scenes where someone is in The Zone and the people around them take great pains not to interrupt. They know how important it is.
The Zone is where you are at your most productive. It's where you can do a wholes days work in a couple of hours. Or come up with a solution to a problem that's been dogging you for days. This is why people who are in The Zone tend to a bit testy about being disturbed. It's breaking their chain of thought, right when it's dialled up to 11.
It takes a number of things to get into The Zone - the right mood, people leaving you alone, and and a lack of other distractions. Most people like music to help them concentrate and get into the right mood. So a great pair of headphones is not only the universal sign of hacking, but a must have for The Zone. The best are those really large "Don't bother me!" headphones, because the one thing you really don't want is someone interrupting you. Not if they want to live past the end of the day! The headphones and music also serve a second purpose. They cut down your perception from the world around you to just the space in your head. It's far easier to think about what you are doing if you cannot hear what the guys in the next desk are talking about or someone rattling around in the kitchen.
People I've talked to about The Zone often comment that the best time is when everyone else is gone. No distractions. Either before work (Ugg! not a morning person) or after everyone else has left. Developers are often night people which leads me to suspect maximising Zone Time is why they are often the last in, and last to leave.
The worst thing is having to give up the Zone. For a lot of people, myself included, Zone Time tends to occur later in the day. Which is fine, except that I often have to interrupt it to pack up and to go home. I'm sure my employers/clients would love it if I sat and coded until 10 at night, but ... well, I do have a life.
So how can we maximise time in The Zone? Good question. I think it's a cultural thing mostly. Simple getting people to following a simple rule - When someone has their headphones on, you don't disturb them under any circumstances! Not Ever ! Oh ok - perhaps the end of the world, or a Zombie apocalypse.