David Auerbach writes in Slate about “coder’s high,” an “intense feeling of absorption exclusive to programmers:”

[O]ne of the things I miss about programming is the coder’s high: those times when, for hours on end, I would lock my vision straight at the computer screen, trance out, and become a human-machine hybrid zipping through the virtual architecture that my co-workers and I were building. Hunger, thirst, sleepiness, and even pain all faded away while I was staring at the screen, thinking and typing, until I’d reach the point of exhaustion and it would come crashing down on me….

In his study Zen and the Brain, neuroscientist James H. Austin speaks of how one’s attention will shift into “a vacancy of utmost clarity, a space so devoid of the physical self.” I don’t know if programmers get all the way there, but their ability to tune out the world while working is remarkable.

I don’t know if this is “exclusive to programmers;” flow states are pretty well-documented in many different fields, and I suspect that arguments about whether programmers or surgeons or composers feel them more deeply will quickly collapse into a proxy war over who’s smarter, or who the world likes best. But certainly the idea that working on software can put you in a state of deep concentration is not new. Ellen Ullman opens her great memoir Close to the Machine with this:

I have no idea what time it is. There are no windows in this office and no clock, only the blinking red LED display of a microwave, which flashes 12:00, 12:00, 12:00, 12:00. Joel and I have been programming for days. We have a bug, a stubborn demon of a bug. So the red pulse no-time feels right, like a read-out of our brains, which have somehow synchronized themselves at the same blink rate.

“But what if they select all the text and –”
” — hit Delete.”
“Damn! The NULL case!”
“And if not we’re out of the text field and they hit space –”
“– yeah, like for –”
“– no parameter –”
“So what if we space-pad?”
“I don’t know … Wait a minute!”
“Yeah, we could space-pad –”
” — and do space as numeric.”
“Yes! We’ll call SendKey(space) to –”
“– the numeric object.”
“My God! That fixes it!”
“Yeah! That’ll work if –”
“– space is numeric!”
“– if space is numeric!”

We lock eyes. We barely breathe. For a slim moment, we are together in a universe where two human beings can simultaneously understand the statement “if space is numeric!”

Joel and I started this round of debugging on Friday morning. Sometime later, maybe Friday night, another programmer, Danny, came to work. I suppose it must be Sunday by now because it’s been a while since we’ve seen my client’s employees around the office. Along the way, at odd times of day or night that have completely escaped us, we’ve ordered in three meals of Chinese food, eaten six large pizzas, consumed several beers, had innumerable bottles of fizzy water, and finished two entire bottles of wine. It has occurred to me that if people really knew how software got written, I’m not sure if they’d give their money to a bank or get on an airplane ever again.

But she argues that while part of the state is a pleasure, there’s also a defensive element to it. The complexity of projects eventually leads to a point where

the programmer has no choice but to retreat into some private interior space, closer to the machine, where things can be accomplished.The machine begins to seem friendlier than the analysts, the users, the managers. The real-world reflection of the program — who cares anymore? Guide an X-ray machine or target a missile; print a budget or a dossier; run a city subway or a disk-drive read/write arm: it all begins to blur.