Serenade for a Compiler

I have my classical guitar in the corner of my office. When working, there'll be a time when I have to wait for a minute or two for a process in AWS to finish or for code to compile. That pocket of time is just enough for me to break out my guitar and play a piece or improvise. It feels like playing hooky, but I also couldn't help but think it's a better use of my time than checking my work email. Interestingly enough, a recent episode from Deep Questions with Cal Newport (Ep. 84), gave me the explanation for why that was the case.

Newport talks about keeping a cognitive context free from distractions that require resources from that cognitive context. The example in the episode is compiling code. What he suggests not to do is check your email. That frazzles your cognitive context and sends you down a spiral of responding to email rather than focusing on the programming project you were on already. He instead suggests an activity that operates from a different cognitive context, preferably a simple physical activity:

Keep your mind occupied without changing the relevant networks you already have queued up and ready to go for the cognitive work that you're in the middle of [...] It can really preserve a bit of cognitive context because it gives you something to focus on that's using a different part of the brain.

Playing guitar checks those boxes for me. I never thought about how it preserves cognitive context until playing a little bit today when I was stuck on a work problem. Even though I concentrated on playing a piece, I could still keep my focus on the issue — the cognitive context remained. If I were to go to my email instead, everything would go out the window. It doesn't with music.

I guess music activates a different part of my brain, which is so obvious yet somehow wasn't in this context of work.