Monday 10 October 2011

Working efficiently while listening to music. (a replyto @unclebobmartin)

I'm currently reading The Clean Coder book from Uncle Bob. It's a must have on the (virtual) bookshelf for everyone who's in for self-retrospectives and continuous improvement. I could praise his work for pages, but the post is about working to music.

Uncle Bob tells us about his experiences, which I think should be familiar to all who ever tried to craft to music.

At Teradyne, in the late ’70s, I had a private office. I was the system administrator
of our PDP 11/60, and so I was one of the few programmers allowed to have a
private terminal. That terminal was a VT100 running at 9600 baud and connected
to the PDP 11 with 80 feet of RS232 cable that I had strung over the ceiling tiles
from my office to the computer room.
I had a stereo system in my office. It was an old turntable, amp, and floor
speakers. I had a significant collection of vinyl, including Led Zeppelin, Pink
Floyd, and … . Well, you get the picture.
I used to crank that stereo and then write code. I thought it helped my
concentration. But I was wrong.
One day I went back into a module that I had been editing while listening to the
opening sequence of The Wall. The comments in that code contained lyrics
from the piece, and editorial notations about dive bombers and crying babies.
That’s when it hit me. As a reader of the code, I was learning more about the
music collection of the author (me) than I was learning about the problem that
the code was trying to solve.
I realized that I simply don’t code well while listening to music. The music does
not help me focus. Indeed, the act of listening to music seems to consume some
vital resource that my mind needs in order to write clean and well-designed code.
Maybe it doesn’t work that way for you. Maybe music helps you write code. I
know lots of people who code while wearing earphones. I accept that the music
may help them, but I am also suspicious that what’s really happening is that the
music is helping them enter the Zone.

Robert C. Martin, (May 23, 2011), The Clean Coder, 63
(quoted with the author's permission)

I truly understand what he's talking about. Been there, done that. I wasn't happy that I couldn't listen to the music I really love, so I started debugging my working process to find a way which to a productive state of mind while listening to music. Preferably music I like.

I pretty much consider my self a very eclectic person when it comes to music, but I do have some cornerstones in my taste which can be identified clearly. These all influenced me in a way I'd never forget:

  • Rap with appreciable music 
  • Rap Metal
  • Rap Rock
  • Heavy Metal
  • Punk Rock
  • Doom Metal
  • Gothic Metal
  • EBM
  • Industrial
  • Electro
  • Trance
  • Goa
  • Progressice House
  • Hardstyle
  • Rave
  • Dance

At the time I started deliberately measuring my mood while listening to music, I was way into the Doom/Gothic metal. Delain, Nightwish, Lacuna Coil, Within Temptation, Haggard and etc. Even if you're not into metal, try bearing a few minutes of this track.

As it turned out, my musical education since I was a toddler enabled me to break down music to individual instruments and channels while listening to it. Haggard is a great example of a complex composition which triggers my brain to start decomposing it. Every time I hear it, it's a new adventure of musical discovery. So even that I love this tune very much, I had to ban it from the working hours.

As I continued to experiment with more and more genres, a pattern started to form. Every tune with variable beat rate, or with complex instrumental composition was sucking my focus away from work. I still didn't give up on the statement that I do want to enjoy what I'm hearing, so I stepped into another world which I was happy with. Dance/Pop/Radio-friendly stuff. You know, all those lightweight music which can go on for hours without you noticing them on the radio. While you're not even aware of those at the mall or a hairdresser, they have an effect on your subconscious (as it is meant to spread at that level). You find yourself humming the tune and forming the lyrics with your lips. You might not feel distracted, yet you are extremely unproductive.

I started seeking online radio stations, but I had a hard time finding one which played acceptable music for my taste all day. Whenever I tuned into one which was playing something cool, it got worse short after. I had days when I listened to Infected Mushroom all day just to keep me going. When I tuned into a psytrance station to get more, I found myself listening to some really annoying crap. Those Infected Mushroom-ish days were my most productive days I had in years. What I really liked about them is that though it gave me quite an energy-boost due to that 138-150 BPM speed, the high sounds kept me from going into the flow too deep. Sometimes I got lost for some seconds in the music which was enough for my brain to think about what I just did on the screen.

So I went looking for high-energy music, but I didn't have the stamina to collect work-compatible goa enough to fill even a day without repeats.

The best psytrance radio station I found was the one on I started looking around in their stations when I got annoyed way too many times, and suddenly I found the station which kept me going for over than 3 years now: Classic Trance Channel. Not many of you may know that I was a trance dj for quite some time back in my past, and this station plays all the great music from that era. I know these songs so much, that I don't even need to think about them. The only problem was that I still got distracted by the euphoria each song caused as memories associated with the tune started to take over my thoughts. I was pretty happy with these "distractions" though, I felt like two worlds of my soul have finally developed a common interface. (The DJ and the coder)

It was not so long ago when I accidentally tuned into another station and didn't realize it for several days. It was the Trance Channel.It plays some nice psy, progressive and classic tunes, old and new which just got released on beatport.

Guess what! I even heard a song coming from the EBM/Industrial world. I did shed a tear at that moment. Why did I settle with this genre?

Since I started caring about my health, I am aware of how the heart rate influences my well-being. I know that there's a scientific rate which is the healthiest to one's body. It's the 60-70% of your maximum heart rate, which is 220 minus your age. With my current age:

((220-26)/100)*65 = 126,1

And guess what beat-range trance operates on?

Trance is a genre of electronic dance music that developed in the 1990s;[3]:251 generally characterized by a tempo of between 125 and 150 bpm

via Wikipedia

Basically listening to trance music tunes my body into perfect balance and pulls my productivity way up. Of course, the beat itself should be enough to reach that, and here comes the musical taste to play. The vocals and the pads in trance music let me escape the flow if I wanted it to. I can always close my eyes for a few seconds, get lost in the music and re-think what I just wrote on the screen. Of course nothing beats pairing with the right partner, but for times when I work alone, there's music.

You may ask why I'm so keen on escaping the flow, as it is a super-productive state of mind. Yes, and no. If you have tests and relatively short pomodoros, there's nothing wrong with 1-2 flowing cycles. But not more. The explanation is to be read in The Clean Coder. :)

p.s.: Thanks to @unclebobmartin for letting me quote an entire section!

update1: Why Does Music Affect Your Heart Rate? article on


  1. I went through a similar process, although much less scientifically. I found that I work best to music I know so well I almost don't hear it OR to various types of techno. It's funny, because I don't really like techno that much but when I code to it I find my fingers hitting keys to the beat, which is really kind of a weird sensation.I need music in my home office to drown out the kids, so silence isn't really an option. Trust me, whatever impact music has on my productivity is less than hearing the disney channel through my wall.Dave

  2. Just a side-note about the "healthiest heart-rate": that rate is healthiest for endurance/cardio trainings, like swimming, cycling, jogging. It is not meant to be kept all day long; nor is it good to boost ones thinking capabilities.It creates a huge load of endorphins in your brain though :)

  3. Yep, that's true! Luckily tuning your brain to that beat doesn't mean that your HR goes there too. I just believe that feeding your brain the same beat which is the same as your "in zone HR" could be more useful than lower/higher tempo. I might not have been clear on that :)

  4. Hey @aldos, I have the same issue with our cat's loud meowing. I try not to work at home though, it helps a lot! :)

  5. Brain-Heart-Rate, that's an amazing metaphor! I will use it :)

  6. What other albums would you recommend like Infected Mushrooms or other similar artists you like to work to ?... I am currently working to Converting Vegetarians & also Psy-Trance Euphoria mixed by John '00' FlemingCheers


Note: only a member of this blog may post a comment.