The high price of context switching for developers & ways to avoid it

Developers don't like to be interrupted. Ever wonder why? Well, the one-line answer is, "Context switching is super hard!".

Context switching is expensive

Ever wonder why developers don't like to be interrupted? Because switching contexts has a very high cost on people who do deep work. Jason Heeris illustrates with an example what damage a simple ping can do to the developer’s flow.

Source: Jason Heeris

Cost of interruptions

Chris Parnin looked at the cost of interrupting developers, and made some powerful observations:

  • A programmer takes between 10-15 minutes to start editing code after resuming work from an interruption.
  • An interrupted task is estimated to take twice as long and contain twice as many errors as uninterrupted tasks.
  • A programmer is likely to get just one uninterrupted 2-hour session in a day.

Meetings are the biggest source of interruptions

As Paul Graham wrote in his seminal 2009 essay:

“A single meeting can blow a whole afternoon, by breaking it into two pieces each too small to do anything hard in. Plus you have to remember to go to the meeting. For someone on the maker's schedule, having a meeting is like throwing an exception. It doesn't merely cause you to switch from one task to another; it changes the mode in which you work.”

Techniques to minimize context switching

We can find flow in the world of constant interruptions. Here are some approaches, used by the most productive developers across the world, that we like:

Time blocking

Divide your workday into blocks of time. Each block should have the goal of completing a specific task.

Eg. "Catching up on email and slack messages", "Doing deep work", "Office hours and meetings".

Time blocking helps give a clear structure to your day.

Time batching

Doing similar tasks together in a batch reduces context switching and increases efficiency. Eg. Doing all code reviews together, or answering all emails and slack messages together once or twice a day.

Turning off notifications during deep work

Get in control of your attention. Kill notifications from email, Slack, Whatsapp, social media, and other communication systems.

For eg. enabling the DND mode on Slack is especially effective when you are trying to get some uninterrupted maker time.

Prioritization

Focus on tasks that can have the most meaningful impact. Don't get lost trying to tackle a laundry list of seemingly urgent tasks. Jeff Bezos says that his secret is making fewer, better decisions, and thinking long-term.

Eating that Frog

Brian Tracy, author of Eat That Frog, author of Eat That Frog, recommends tackling the biggest task first thing each morning. You must develop the routine of “eating your frog” before you do anything else. Frog is a metaphor for  your biggest, most important task. Also if you have two frogs, eat the ‘ugliest’ one first.

Adopt asynchronous communication

It is important to focus on the quality of communication rather than speed. Help your entire team understand the benefits of async communication. Exert your influence to create a culture of not giving an immediate response to chats.

How to minimize context switching

Apps to help you stay in flow

We have compiled a list of eight interesting productivity tools/apps that help developers minimize context switching.

Forrest App: Helps you stay off your phone. Whenever you want to focus for a chunk of time, you 'plant a tree' in this app. The tree grows while you are working, and dies if you leave the app. Sounds amazing right!

CodeStream: An open-source extension for VS Code, Visual Studio, and JetBrains. It puts collaboration tools in your IDE. It has integrations with GitHub, BitBucket, GitLab, Jira, Trello, Asana and provides code discussion that ties it all together.

Tuple App: Distraction free remote peer programming app. It is fast, lightweight tool built for developers that fades into the background and lets you focus on being a great pair.

Brain.fm: AI generated music to improve focus. This is for you if music / ambient noise helps you focus better.

RescueTime: Analytics on your daily habits and productivity. RescueTime helps you see exactly where your time goes. You can block your worst distractions, and see powerful charts to make your day more productive.

The Silver Searcher: A Code Searching Tool. As developers, more than the time spent to write code is the time that goes into reading code or searching for a specific code. Code-searching tools like Silver Searcher can help save a significant amount of time.

Habitica: This is a fun, habit-building app that turns your whole life into a role-playing game. It helps you concentrate on the tasks you actually want to get done.

Paco: This is our product. Paco allows developers to go async on Slack, hence reducing the need to interrupt their flow.

Our favorite tools for preventing context switching

As we get more used to remote working, our work culture should evolve to recognize the cost and impact of context switching. We can all do our part by helping socialize these techniques and tools at our workplaces.

---‍
Credits: Cover image from Freepik Storyset and icons from Icons8