You probably have experienced it already: meetings scattered throughout the week. Regardless of how relevant and efficient they are, it always takes time to get back to the work you planned to do after. Actually, "it takes an average of 23 minutes and 15 seconds to get back to the task” according to a study from the University of California Irvine (here's the paper).
Reducing the number of interruptions at work is essential if you want to achieve a flow state. Some of it should be addressed in your context (less unnecessary meetings, preserve large slots of time uninterrupted), and some of it could be tackled on your own (turn off notifications, close emails, prevent web surfing).
Now, this post is not about that. Let's not talk about how to reduce interruptions, but how to speed up the recovery!
Besides meetings, developers are generally frustrated to be interrupted because it makes us lose our train of thought…
Source: Monkey User
This is a fact. Studies have shown that any interruption would have such effects. But what if you could get back into "what you were doing" faster? Think about meetings: you know when they will take place. Imagine you could prepare yourself so you would get back to a productive state of work quicker than your peers! Instead of losing 20min before and 20min after, you would efficiently lay the ground for getting back to the code faster.
Here are 3 techniques that can help you in doing so.
If you know in advance when the interruption will happen, you can anticipate it. There's one thing you can control: when to stop. If possible, stop before you finish something clear to you. Don't complete all the next steps that you know how to do.
Indeed, it's easier to get back to a task when you know exactly what's the next step. The momentum of doing the easy task helps you get back to work. You progressively immerse yourself into the code again. Once you are used to it, tackling the next less-certain thing will be easier.
This isn't specific to code. Actually, it is exactly what Ernest Hemingway advised to cure writer's block:
I always worked until I had something done and I always stopped when I knew what was going to happen next. That way I could be sure of going on the next day. — Ernest Hemingway, A Moveable Feast
Stop when you know exactly what to do next. Before you leave for the meeting, leave a
TODO comment in the code for when you come back. That works well!
If you are a TDD practitioner, here's a variant that works even better.
The heart of the Test-Driven Development lifecycle beats at the drum of the 3 steps:
- Red, write a test and see it fail
- Green, make the test pass with just enough code
- Refactor, clean up the design without breaking the tests
Source: Spec India
TDD is more than "write the test first". The Red step is critical as it forces you to think about what should happen next. You express your intention in what you want the code to do. You also prove that it's not doing it right now.
If you ask me, Green and Refactor are the easy steps. Well, I don't mean it's easy to write "just enough" code or refactor existing code towards a better design. That takes a lot of practice to do it correctly. But once the Red step is done, the next step is clear: make this test pass.
Hence, a perfect moment to stop working is on the Red step. Before your meeting, make sure you stop once you have written the next test. Don't make it pass yet. Save it for when you come back.
It's a note to yourself. Clear instructions to follow so you get back to the code faster.
This tip works in the long run. It's about helping your brain get to work faster. An efficient way to doing that is by creating a ritual.
Nothing magic or creepy in this. Creating a ritual means that you make a routine to get back to work by repeating the same tiny steps every time. For example, some of these steps could be part of your ritual:
- Put your headphones with music you love every time you start a work session.
- Take 3 deep breaths and smile before you touch your keyboard.
- Get yourself a cup of tea/coffee/water and take a sip before you sit.
- Stand up and hold a power pose for 1 minute.
Here's my personal focus ritual since I'm working from home:
- I put my headphones on and turn my Focus playlist on
- I light up some incense
- I launch a timer for the time I plan to work uninterrupted
Your focus ritual is personal. With some practice, you'll find what works best for you.
By practicing the same ritual before getting into a work session, you train yourself into recognizing the work session is coming. Whenever I put on my headphones and light up some incense at my desk, my brain prepares itself to get into the zone. I feel it's easier to get back to work after a meeting when I'm performing my focus ritual.
The power of a focus ritual comes from repetition. It's a habit. You're conditioning yourself into being focus and efficient as soon as you start your routine gestures.
Also, I recommend that you turn off all notifications as part of your ritual. Snooze them all for the work session you planned. Put your phone away. In general, the world can wait 30min before hearing back from you, you won't miss out.
Did you ever got back from your meeting, but struggle to get back to the work you left off? For some reason, you kept postponing it, wandering around on Slack, surfing on the web, checking your emails… Everything but the main thing you had to do.
If you have a hard time getting back to the work, use the Five-Minute Rule:
Start a 5min timer and tell yourself you're only going to do the task for that long.
When you can't get yourself to doing something, the solution might be to scale down that something into a dead-easy version. Sure you can spend only 5 minutes on that!
The trick is: getting started is the hard part. With the Five-Minute Rule, you are making that easy. Chances are you'll keep working after the 5 minutes are gone!
I find starting a timer really efficient. It helps my brain trust that I would only spend these 5 minutes, then I'd reconsider. Most of the time, I decide to continue further.
Sometimes, I'd bail out after 5 minutes. That's fine, that was part of the deal! When this happens, I'd usually revisit my expectations for the rest of the day. Maybe I don't have the energy to tackle this task now, and I'd better do more shallow work instead. Usually, it also means that I need to take a 15min break away from the screen.
Kévin Systrom, Instagram co-founder, referred to this technique as his favorite life hack. James Clear, the author of Atomic Habits, proposed a 2-Minute variant for fighting procrastination and adopting new habits. When you can't get into something, make that thing really easy to commit. Even if you don't get further, the habit of going for it will pay off over time!
Furthermore, it's generally enough to get back into code after a break ✌
Getting back to work after a break takes time. You need to switch context and dive into that specific task again. Meetings can feel cringing because they take more time away from doing things than the reserved slot in the calendar. Although many meetings could be avoided, some of them can't—except if you practice ensemble programming, you have to sync up with the people you're working with at some point.
When you are in this situation, a few techniques can help you get back to code faster:
- If you can anticipate, stop working when you know exactly what to do next. Save something easy to do for when you come back.
- Create a focus ritual, a routine that will help you get into the zone faster.
- If you're struggling to get into it, tell yourself you'll only spend 5 minutes on it. Often, that's enough to get started. Next thing you know: you are done with your task!
These techniques work well when you come back from a meeting, but also with any kind of break/distraction. I like to stop my day on a failing test, then start the next day with my focus ritual—yup, my incense is burning right now and my Focus playlist is playing through my headphones. 🎧
Photo credit: Chris Montgomery.