“Run into an obstacle in what you’re working on? Hmm, I wonder what’s new online. Better check.”



If you haven’t already, you should start reading Paul Graham’s essays. In one on philosophy, Graham believes that many of the answers provided by philosophy are useless because “…of how little effect they have”. By that standard another of his essays is of high utility because it has affected the way I program. John Stuart Mill would be pleased.



In Disconnecting Distraction Graham tells how he finally dealt with the incessant distraction of the Internet — he simply disconnected his main computer from the network. The simplicity and possible effectiveness of this really intrigued me.

So, for the past two nights of programming, my own computer has been completely disconnected from the network. I pulled the cable from the router — and this is important — on the far side of the room. And that amount of friction was just the right amount that I stayed disconnected while coding.

What happened next

The number of times the mind wanders to check the Internet is stunning. It’s only when you can’t access it, that you realise it. It is from Disconnecting I take the opening quote, and it will ring true for many developers.

Without constant access, when you hit an error you’re forced to actually study what is in front of you, to fully understand what the computer is telling you. No more punching an unfamiliar and cryptic error into Google to see how to deal with it. No more fruitless detours down messy mailing list archives, hoping to find an answer.

Without distraction, a virtuous cycle begins. Less distraction means more productivity. And more productivity means an easier transition to the zone.

And there is a critical second-order effect: we all know that the more effort you expend in acquiring a piece of information, the more likely you are to remember it. This means that the knowledge gained during a disconnected programming session is actually learned, not just swapped into your working set from Stack Overflow, only to be quickly evicted when the next error occurs.

RTFM

Programming in Go means that disconnecting from the network is actually a pleasure. Go comes with a great tool — godoc — which allows you to spin up a local web server, serving up all the standard library’s documentation, and presenting it in an identical fashion to the online version. godoc is another testament to the quality and coherence of the Go tool chain.

To me this was key — really useful, accessible, offline, documentation, in electronic form, to help me during coding. It’s been a couple of years since I did any serious Python programming, but one of the first things I would do before starting again would be to try mirroring the documentation. That way I would have a local copy, and could then disconnect. And I’d do the same for C++.

So, really 1999?

Perhaps not. I sent my first e-mail in 1993 so I’ve used the network for a long time, but coding-via-StackOverflow is a 21st century phenomenon. So try travelling back to an earlier time, disconnect, and reap the benefits.

Postscript