Code at 30,000 feet

by Alan Shreve

A week ago, the post ”I wrote FAT on an airplane, for heaven’s sake”, on Raymond Chen’s popular blog The Old New Thing was making the rounds on the interwebs. In the dramatized story, a frustrated Bill Gates wants his engineers to stop wasting time on some trivial performance tuning, don’t ya know he wrote a file system on an airplane, for heaven’s sake.

And while Gates’ claim is obviously hyperbolic, it’s certainly not the first time I’ve heard “on a plane” used to exemplify programming virtuosity. A former colleague liked to say of another, “He doesn’t code much anymore, but he wrote the whole counters system on the plane flight back from a pitch meeting.” The boastful or reverent nature with which we say these things betrays the interesting assumption that airplanes are not conducive to effective work.

So that got me thinking about when I’ve worked on airplanes (or buses, most recently). And for me, I think the exact opposite is true. Planes (and trains and automobiles) are a perfect incubator for productivity because they compose four major factors of a productive environment which rarely align in an office setting or at home:

No interruptions

On an airplane, your interruptions are limited. You won’t get any text messages or phone calls. No one will come over to your desk for a quick question. Most of your fellow travelers are uninterested in conversation. They want to sleep, read or watch their in-flight entertainment. If you’re lucky enough to be on a flight without wifi, you won’t even get those pesky emails or chat messages.

Few distractions

There’s just not that much to do on an airplane. You can’t get another cup of coffee down the street or step away to bang out a round of Foosball. Until recently, the lack of pervasive wifi on flights made it even better by curbing that impulsive news-feed, Twitter update scrolling habit you can’t seem to shake. Unless you brought along a book or really enjoy watching last year’s romantic comedy, there are just very few ways you can get yourself off-task. For breaks, I just close my computer and my eyes for five to ten minutes. I find it lends itself well to sub-conscious problem solving.

Guaranteed time

I might have put this first because it’s perhaps the most important. On the ground, even if you manage isolate yourself from interruptions and distractions, how long will it last? I have a serious mental aversion to entering a highly focused state when I know I won’t be able to maintain it. “I have that meeting at 11:30, so I don’t want to get started on anything big” is a variation on a thought that is all too common for me. On a plane flight though, you’ve got a printed receipt for a very real guarantee of uninterrupted time.

A brief period for inspiration

Excepting those with aviophobia, that meditative, relaxed, sub-conscious problem-solving mental state that’s credited with making the shower a place of great inspiration reminds me a lot of takeoff. It’s a 10-15 minute lull where no electronic devices are permitted and your mind can drift around solutions to problems you’re intending on solving when you hit cruising altitude.

Of course, there are undesirable side-effects. An isolating flight might prevent me from accessing useful documentation and Stack Overflow. I find I end up reading the source code for third-party libs more frequently up in the air. And sometimes I really do want to take a break outside and unwind in the sun. But on balance, my creativity and productivity spikes frequently during my reclusive retreats in the sky. And judging by the follow up post and comments on The Old New Thing, I’m not the only one.

The next time you want to impress someone with your coding chops, tell them about that time your hacked up an OS scheduler while on a conference call with a tab open to Reddit.