Context switching is the mind killer

Fear is the mind killer quote from Dune


There’s plenty of fear in software development but it’s really context switching that kills your brain.

one week calendar with many appointments

This was my week. The yellow is supposed to be three precious hours when I don’t have any meetings and can focus on my stories for this sprint. As you can see, the yellow was intruded upon almost every day this week by blue and green. Blue and green is the stuff I can’t say no to.

Red means I can be interrupted at any time all day. I took a day of red for S. so she could have a damn break and because she takes a lot of red for me. I am happy to take a day of red for her. As red days go it was not bad. But it was still a red day. Next week every day will be a red day, as it is my oncall week.

My point is that context switching is a problem.


I have what I think of as templates (some might say rituals or habits) to help me speed up the switch from one brain occupation to another, usually from a meeting or a call or a ticket or an instant message or an email that cannot be ignored (I summarize all of this as whatever) to actual code work.


Once upon a time I sort of lightly used Eclipse but never got it properly set up. About a year ago I worked on a team that played with a bunch of Javascript frameworks to pick one for the department to use. A proper IDE was a requirement for that project so I adopted IntelliJ along with everyone else.

I am horrified now at the thought of trying to work without my beloved IntelliJ. Having every tool I need for dev work in one gigantic window is so, so much better than switching around between various apps and the command line.

Being able to bring up my project with one click and have everything in the state in which I last left it – everything – really kills a lot of context switching penalty. It’s an astounding experience after having worked without it for so long.


Playlist called SweetnessI listen to the same playlist on my phone on continuous loop. I listen on headphones. I may be completely sick of the songs but it doesn’t matter. The right music takes a noisy part of my brain and quiets it so I can focus. I may switch between playlists from time to time but not very often. The small action of putting on the headphones and putting on the music shuts out the world and sends me a mental signal that it is okay to think only about my code work now.

I don’t always get to choose what playlist I am going to be stuck with for a week… or two. Lately it has been a lot of Van Morrison and Led Zeppelin, so help me.

Social Media

Oddly enough, taking a brief social media break between whatever and dev work clears my mind and makes it easier for me to settle down and focus. I didn’t even realize I was doing this for a long time. In fact, I believe I have been doing this in some way for years. The social format may change with time (email, newsgroups, facebook, twitter) but briefly leaving the office (mentally) is extremely helpful. Twitter is particularly awesome for this because it is by its nature brief.


This is sort of a last resort. I have a few pictures, mostly of the people I love the most or of things that make me feel quiet and focused, that I keep around. If it’s a really bad day, I might keep a bunch of them up on my desktop and when my focus strays, I look at them and they encourage me and refocus me.


Sherlock - Keep Calm and Think
Yeah, okay. This one is my desktop all the time, although it tends to be hidden by 1000 windows when I need it the most.