Category Archives: Productivity

Self Control

Since my computer is factory equipment, I consider its ability to show me news and social media a defect. One easy fix is to edit /etc/hosts to block these sites, but that’s reversible by just re-editing it. A year ago I found an app, SelfControl, that takes these edits out of my hands.

To set it up, you give it a list of blocked sites. Then, when you start it, it will put entries into /etc/hosts that sets their IP addresses to 0.0.0.0. If you remove these entries, it will keep reapplying them. And since it asks for privileges, it can do this in a complex way. You could thwart it if you wanted, but it’s enough of a pain that you probably won’t bother.

After using it for a while I added a few practices that make it more useful.

  1. I use the Due app on my iPhone (and Watch) for simple recurring reminders. I set up a morning reminder to restart SelfControl.
  2. I went into my /etc/hosts and made a copy of the SelfControl section (it’s clearly marked with comments) and made it a permanent part of my hosts file. I italicized permanent because I can edit this part, but it’s there to be a little bit of a deterrent if I try to go to any of these sites in a non-blackout period.
  3. At the end of the week, RescueTime sends me an email with a summary of my productivity. I can easily see if any new distracting sites are taking significant time and add them to SelfControl.
  4. I found an app for iPhone called Zero Willpower that does the best it can to replicate SelfControl on the iPhone. It’s essentially a content-blocker that you can edit and a timer you can set to disallow deleting. On the iPhone there is nothing they can do to stop you from removing the app or disabling its content blocking privileges, so thwarting it is easy if you want. Again, it’s enough of a pain, that it’s enough to keep me off distracting sites.

Deep Work for Programmers

In Deep Work, Cal Newport makes the case for sustained, focused work on hard problems and gives practical advice for helping you do it. The book helped me realize why two practices I had adopted were working so well. They are both related to the mindset I have about my computer and devices:

  1. I think of the computer I program on as factory equipment.
  2. I monitor my usage of it and make it impossible to do anything that interferes with productive work.

Most of the tactics I employ flow from adopting those two practices.

Your computer is factory equipment

To me, it’s a big problem that the same computer I use to write code can also go to Reddit. And Slack. And Gmail.

It’s bad that the phone that I develop apps for also gets text messages, calls, and other notifications.

The typical way to treat these machines is to use them as intended — as a general purpose machine. But programmers are not typical users of computers.

Imagine if Picasso’s paintbrush rang a few times a day. Or if Jane Austen’s notebooks also showed Tweets. Maybe we’re not doing as important work, but coding requires long spans of deep concentration, and we don’t need distractions to be a CMD-Tab away.

Business communication apps like Slack and e-mail are a tougher problem as it’s usually not ok to not run them at all. But even our collaboration apps can be a distraction if we don’t control their use.

If you accept this, it’s logical to take steps to turn this general purpose machine into just a coding computer.

Monitor your productivity

It’s hard to convince most people that they have no idea how productive they are, but you don’t need to trust me. Do this test:

  1. Write down how many hours you think you spend coding, doing business communication, and other work activities during the week.
  2. Go install computer usage monitoring software like RescueTime or Qbserve and let it run for a week.

I have been spending my whole career trying to measure and optimize my productivity. I used to do this more manually — just jotting down the number of hours between programming interruptions (this is a Peopleware suggestion) — but these tools are far more accurate and unforgiving. Even with diligence, I was surprised where my time was going.

But even more important than monitoring your work is doing something to increase the number of contiguous hours you spend programming (and on programming-related activities — code review, testing your work, technical documentation, estimation, etc).

Cal argues that there are two kinds of work we do:

  1. Work that only experts can do
  2. Work that you could train a smart intern to do in an hour

Look through your logs and try to figure out how many hours in a row you are spending doing the things that need your expertise (or expertise you want). You may still need to do the other work, but the time spent should be shrunk and sequestered to not interfere with the work that matters.

This doesn’t even address distractions like social media, time-wasting sites, or non-business communication. I’ll let your logs speak for themselves on whether you have a problem, but they will probably be incomplete since most of these distractions come on your phone, which isn’t as easily monitored.

Since usage monitoring software can’t be installed on an iPhone, I just assume that my phone is a giant distraction and set it up accordingly. Android users can install RescueTime, which I would recommend.

In the coming weeks, I’ll expand on my suggestions and explain my personal setup. If any of this sounds interesting, go read Deep Work, as Cal lays out the fundamental approach and many actionable suggestions.

NOTE: Here is a follow-up to this post with more details on how I use SelfControl.