Writing software is an activity that requires uninterrupted periods of deep focus.
You’re thinking procedurally through the logical implications of minute differences in abstract structures.
Each interruption, or a ‘context switch,’ represents significant wasted attentional overhead, as it can take 20-30 minutes to get back into your flow state.
I explained it once to a product manager friend of mine this way:
Imagine you’re a terrier, and you’ve been asked by a human to go into a gopher hole, and traverse an expansive network of gopher tunnels to eventually locate the gopher and bring it back to the surface.
Every time the human calls you back up to the surface to ask a question or adjust the parameters of their request, you then have to go back down into the tunnels, and reorient yourself. Where are you, again? Which tunnels have you already traversed? Which one were you in the middle of traversing? etc.
Silence is the Absolute Best Environment for Concentration
If you need to achieve a deep focus, the research shows that you really want a perfectly silent environment:
Further, if you’re going to listen to music, it’s more optimal to listen to repetitive, non-stimulating music without language or vocals:
Choosing whether to listen to music or not is within your control, but if you’re working in an open office environment, the conversations of your coworkers are omnipresent and not within your control.
So what can you do to mitigate this focus-threatening environmental factor?
A Software Engineer’s Best Friend
Enter these guys, right here:
Total focus for $13.
I have two pairs: one for home, and one for the office. I take them to the library with me. I even combine them with earplugs to even greater effect. They’ve been extremely useful in preserving my ability to focus in any environment.
If you’re working in an open office, I highly recommend giving them a shot.
If you do choose to listen to music, you can even tuck your earbuds inside to get a nice noise-canceling effect.