Note: for the faint of heart not interested in reading my stupidly long post, feel free to scroll to the bottom to see the summary+

One thing that drives me absolute crazy is waiting. I am very impatient. So any time I am performing a programming or administration task that requires waiting for more than 10 seconds or so, I end up looking for ANYTHING to ease my boredom. So when I need to kill 30 seconds while something processes, I end up distracted by reddit, blogs etc. Then, 30 minutes later, I realize I have been off on some tangent instead of working, and have essentially wasted 29 minutes of my work day.

One recent approach I tried was less effective but perhaps still interesting thing I've done lately is fill in the gaps by learning my editor during long waits. In my case, this is vim (specifically macvim). You end up sometimes missing the completion of the task, but at least its arguably more productive than getting lulled to reddit sleep. And how else would I know that zomfg, vim has a built in genafyngr gb ebg13 command ("g?").

But then one day I accidentally stumbled across a very profound idea. If I have something happening in the background that is just interesting enough to prevent me from getting bored, but not interesting enough to consume my attention, then I don't end up off on tangents every time I have to wait 30 seconds to 5 minutes for something to finish.

Several different approaches work and I'm sure their efficacy varies according to individual habits and taste. I used to put on a movie in a tiny window and turn my attention to it when I get bored for a few minutes. But that takes up screen real estate and can be distracting. You're also less likely to notice that the task you were waiting for has completed...

So how do I prevent the tangents but still manage to focus on my work? AUDIO BOOKS. Especially audio books that I've already read in paper or audio form. If it's the first time you are listening to it, it's easy to get distracted by the story since you don't want to miss it. But if you already know what happens, it's easy to completely ignore it while its playing in the background. Then, as soon as you click a button and strike a key that fires off a task that is going to take some time to finish, you turn your attention mostly to the audio book, but keep one eye on the task so you know it's over.

This approach has done wonders for my productivity. Now, I tend to look at reddit, hacker news and google reader as a planned task, or just to kill time when I'm not already coding. Try it my friend. You will love it!!

As an aside, about six months ago I switched from Windows land to Mac land, mostly because: 0) linux has caused me too much pain in my short cruel life 1) I am a languages geek, and it seems like they're available for mac before Windows 2) as a web developer, I often deploy my products on a linuxy server and macosx is much closer to linuxy then windows is. So until recently, I had a much more difficult time staying on task than I do now. Part of the motivation to change came from a reasonably careful assessment of my days, and how each was spent. I downloaded Slife http://www.slifelabs.com/ and Rescutime http://www.rescuetime.com/ ++, both of which can give you a pretty accurate picture of where your time goes when you are sitting on your computer.

-----

+ Summary: Listen to audio books that you've already read while you code.

++ Unfortunately, I don't feel comfortable recommending one over the other. But I will say that Slife required less time to configure and maintain, but at least felt less flexible. I'd recommend either at least in the short term to help you exorcise your procrastination demons. My macbook was stolen about a month ago and I haven't (yet?) installed them on my new one. They were definitely instrumental though in inspiring me to become more productive.