Share this:

To Code With Or Without Music That Is The Question

MusicEvery couple of years or so I seem to come full circle and arrive at the same conclusion, there must be something wrong with me. You see, I hate coding and listening to music at the same time! That’s right, all my friend seem to be able to do it, most people I know swear by it, even popular media tries to push us that way, but I just can’t do it. Music distracts and annoys me when I am coding, am I the only one?

There are 2 schools of thought when it comes to listening to music and doing creative-analytical activities like coding. It all hinges on your right brain (as opposed to your wrong left brain :)).

  • Some people believe that doing a right-brain activity such as listening to music, fully engages that half of the brain. This means that there is no leftover right-brain capacity to devote to your coding task. This will not prevent you from coding effectively, but it does prevent you from being able to do things that are normally associate with the right side of the brain such as, intuitive leaps of logic when debugging, or seeing large patterns in the code and bending them into different shapes. Instead your coding will be more logical and formulaic relying on prior knowledge and opinions you have formed about coding style and practices.
  • Other people believe that listening to music will actually stimulate the right side of the brain making you more able to deal with coding tasks that require right-brain input (such as the ones I mentioned above). This means you’re a more creative, intuitive and a better coder overall when music is playing.

So What About Me

From my own personal experience I have found that I can focus a lot better with no music. I can code fine when there is music playing, but I do tend to be a little more distracted and it really does seem like I am less intuitive and creative when this is the case. Everything I know about learning styles tells me that there should be many other people like me. But, I suspect that the opposite is also true, there are plenty of people who would be more effective coders with music.

So What About You

Much depends on your learning style and how your brain is wired. Because the right side of the brain is involved nothing is immediately obvious, the only way to find out what group you belong to is to engage in some experimentation. You need to try out both styles (with music or without) and observe your effectiveness carefully. Many of you are probably thinking that you already know you’re the musical kinda coder, thing is, I’ve got a sneaking suspicion that some of you are wrong.

We all like music (well, most of us), and many developers believe that because they enjoy music, they should listen to it when they code. This is not necessarily the case. I love music, but much self-examination has told me that coding and music don’t mix well in my case. Music can help you retain information and can help you form associations that you can use to retrieve that same information more easily. But it is only one of the many ways people can form such associations and if you’re not wired as a musical type of learner, it may not be an effective tool for you and may actually be hurting your effectiveness as a coder. Just like I encourage everyone to figure out their learning style, I would also encourage all developers to take another look at whether music and hackery are a good mix in their case. If for no other reason then at least do it for my sake, I don’t want to be the only non-musical coder :).

For more tips and opinions on software development, process and people subscribe to today.

Image by shankar, shiv

  • Mandi

    Actually coding goes through some steps and it is not one of those “on-the-fly” creations.
    Step 1: Analysing and approach solving
    Step 2: Visualisation of the workflow
    Step 3: Coding!
    I don’t believe that anyone is able to go through the first steps by listening music (which of course is a distracting noise to our reflections). As for the 3d step, it is more a reflex than a analytical process, so yes, Coding with Music!!!

    And actually coding with music helps some people (like me) concentrate on the work . The music on the headphones servers as an isolator from any other “noise” around.

    • Alan Skorkin

      Yeah I get what you say about the three steps, you’re right once you have a solution firmly in mind, the rest could be as simple as just banging it out on the keyboard. But what if you’re doing highly exploratory stuff, such as POCs or working/learning new tech, then the three steps are mixed together instead of being contiguous?

      As far as concentrating, that’s the crux isn’t it, for some (like yourself) it is helpful to block out background noise using music, for me I’ve learned to block out background noise pretty easily, so music is just distracting, it’s really interesting how people are so different and have such different strategies for coping with similar issues.

  • Pingback: Te shkruash kod me muzike apo jo, kjo eshte pyetja | Armand Brahaj - Blog Personal()

  • Mandi

    I think there are 2 process involved in the process of programming (!=coding).
    Brain Feeding
    Brain Producing

    I think coding is a pure “brain producing” process. There is involved some small tasks of analysis, but I don’t think there is a problem in analysing small chunks of information while listening to music.
    On the other side, learning new tech, complex data problem solving cannot be done with music on the background.

    Nice post and nice blog by the way :)

    • Alan Skorkin

      Thanks man, and yeah I get what you’re saying, I guess I can block out music now if I had to, if I tried doing it more often I might get better at it and start to enjoy it more :).

  • James

    Mandi pretty much nails it. I’m not gonna buy into the left/right brain theories, it’s simply about choosing the appropriate times to put some tunes on, depending on the activity at hand and the frame of mind. Never underestimate the power of a good groove, in the same way that runners use music to keep tempo and focus.

    You’re right, it can just as easily be a distraction, but for focus and isolation it’s such a good way to indicate to everyone around you that you’re trying to concentrate. It probably doesn’t help that you often code in a pairing situation does it?

    • Alan Skorkin

      I haven’t even thought of it that way before, but I’ve been mostly pairing for the last 5 years or so, and it is tough to get music going when you’re pairing especially with headphones, this may have influenced the way I associate music and coding now, hmmm…

  • Scott Whigham

    Wow, Mandi – that is exactly how I am although I didn’t know it! The actual coding is often just getting it from paper/brain into code; there isn’t that much thought all that often for me when it comes to the coding aspect therefore I can listen to music while I code. For steps 1 and 2 in his/her list, I definitely cannot handle music or distractions. I know of people who can go do this type of stuff at Starbucks or on an airplane but I have a great deal of difficulty really honing in and getting to the core problems.

    However I will say that, for most of my projects, Steps 1 & 2 are often so small that I can do them in a few minutes and then I will sort of switch between the three phases (sometimes all within one minute). If I’m doing that sort of small-project work then I can’t listen to music.

    • Alan Skorkin

      It’s his (Mandi == Armand) I believe :)

  • Robert

    I enjoy listening to classical music sometimes when there is alot of ambient noise around (usually loud annoying people around my cubicle). Sometimes programming tasks are just tedious and don’t require alot of brain activity, then I enjoy listening to music to make things less boring.

    But I see your point about finding music distracting, sometime it just gets in the way. If you’re in the mood for music then play it, if not, then don’t.

    • Alan Skorkin

      I am often in the mood for music, but find that if I play i I just tend to groove to it too much and get nothing done, not always but it happens :). I too often enjoy some classical music.

  • Theo Mills

    Headphones pumping electronic music with little or no vocals + programming = Sunday morning bliss.

    • Alan Skorkin

      Yeah I’ve had a couple of people say that to me now, if there are no vocals people tend to find it easier to treat the music as background noise.

      • Reedo

        For me, it’s good as long as there isn’t thumping bass, which just drives me nuts.

  • Ray Burkholder

    I think that first you have to define music. And then like the others have mentioned, one needs to define coding.

    For music, I differentiate between instrumental and vocal. I can’t concentrate worth a damn with vocals. My preference is for instrumental. Trance to be specific. Trance on to be more specific (no I don’t have an affiliation). It becomes background pink/white noise and blocks the surroundings. It also has a calming effect.

    On the coding side, if I have to think hard about an algorithm, or about integration aspects, I may just turn everything off. But when it comes to describing the solution in computerese, the music will most likely be turned on.

    • Alan Skorkin

      yeah as I mentioned, this is similar to what other people have said to me regarding vocals or no vocals. Thinking about, if it was psy trance or something I reckon I could probably deal with it, if it wasn’t too loud.

  • Charles Feduke

    For 1 and 2, if I have to have music on to block out background noise – which I do quite often in my office – then it has to be wordless music or music I cannot understand the words to (classical, anything instrumental, techno, or opera). When I get to step 3 it seems that music with words is okay (meaning: death metal) even if there is no background noise to block. Do I think this particularly helps me with programming? I’m not sure. I seem to program with or without music when I telecommute where I can control the background noise, just depends on whether I consciously make a “its too quiet in here” decision at some point. I will have to test music/no music and see; maybe with a TDD kata after a couple of weeks.

    • Alan Skorkin

      Yeah, testing it out explicitly is probably a good idea, let us know how you go

  • Naiden Gochev

    I’ve tried many times to code when listening music and I cant.
    I am 100% sure that I am from the people that cannot listen music when they work and code or when they learn something.

    • Alan Skorkin

      Amen brother :)

  • seif sallam

    for me: it depends on the music, if i’m listening to classical music or other relaxing type music it helps me to focus more (because silence kills), other that those types its just distracting and i end-up singing while programming, or leave the keyboard and play with my imaginary instrument.

    • Alan Skorkin

      I’ve known several people who can’t really stand total silence and get less productive, in that situation a little creative background noise, such as music can help. Also you might consider having a tv on in another room, which creates some background noise but not enough to distract.

  • Giorgio Sironi

    I tried to listen music while coding, and it can help to get in the right mood. But I found out that when I enter the zone and start to do some serious work, I cease to listen to it. I simply do not have interest in what I’m hearing and it could be a loud fan noise without me noticing.

    • Alan Skorkin

      I can identify with that, although for me I don’t really even need music to start with, once I get in the zone, any background noise becomes just a faint buzz to me. It’s an interesting effect in my opinion.

  • Nicholas Orr

    I find listening to House (SkitzMix) music, it sets a rythm/beat and my focus is amplified on the task at hand. I no longer actively seek other things to distract me and “get in the zone” so to speak. It generally works better when the music is fairly loud…

    • Alan Skorkin

      I mentioned this in some of the comments above, but I find having the TV on in another room works just as well for me to set my rhythm, it helps break up the silence (silence can be really annoying) but is not actually loud. That’s just me though :)

  • Kevin

    I listen to different types of music depending on the coding at hand.

    Harder rock when creating NEW code. The beat, and I am not talking cranked bass, but the faster pace pumps me up to write new stuff.

    Softer rock / classical / instrumental only when debugging. I need to be calm when debugging. I had bugs, annoyed I created them and want them fixed. I don’t want angry music when debugging as it does not help me calm down and get zen, letting go that I created the problem and letting me go fix it.

    I need to know the music, i.e. the tunes can not be new to me, I have heard them many times before so my brain already knows the lyrics and is not trying to decipher them as I am coding. The music is background noise and blocks out the sounds of the idiots around me who are having inane conversations. I don’t use headphones but keep the music down low that why when someone walks into my pod I still hear them approach and can have a conversation with them. If it turns into a long conversation I will pause the music otherwise it is playing low enough to not bother them as we talk.

    • Alan Skorkin

      The argument about familiarity with music has cropped up several times now. It does seem that if the music is new you tend to try and focus on it, while if the music were familiar you can easily treat it as background noise and not be bothered by it. I find that I have to be *extremely* familiar with music before I can do this. I tend to try and listen in for instrumental and vocal quirks I may have missed every time I listen to familiar music, especially when it comes to classical music.

  • Korny

    I spent years coding to music – I loved it, definitely boosted both my productivity *and* my creativity. I can’t stand total silence, and I find the right kind of music far less distracting than other kinds of background – traffic noise, co-workers, etc.

    But it has to be the right kind of music – either something classical, or something very familiar and predictable, so I’m not really losing any left-or-right brain to the music. Long albums are good – I used to put on The Wall, so I’d get a solid 90 minutes of uninterrupted flow… sigh…

    Of course, these days pairing, and team-leading, mean no music at work :( But in a team environment, it’s far more important to maintain a low-level continual conversation, than to achieve maximum individual efficiency. I’d love some time to try team programming to music – but (a) you’d need a sound-proof team room, and (b) you’d need a perfect agreement between all team members on what music they like – which I suspect would be highly unlikely.

    • Alan Skorkin

      I reckon it would be an awesome idea to try it in a small team and see how it goes. I think you don’t need complete agreement, but you do need agreement that team members won’t put on music that other people really hate :). This is why a small team is the way to go, in a bigger one, there is always going to be someone who hates it no matter what it is :).

  • Pingback: Remember the … code?()

  • Rainer

    Background, wallpaper or elevator music is anathema to me. Music demands my full attention, so i don’t listen to music when i write code, read or study. Pink and brown and white noise is a different matter though, it helps me focus.

    • Alan Skorkin

      I am like you in that regard I think, I tend to want to devote my attention to music if it is playing.

  • Michael Dickens

    I think that it really depends on how your brain works. Some people prefer to listen to music, others don’t. I personally listen to music about a third of the time that I spend coding. I find it enjoyable, but I think it lowers my productivity somewhat since I end up getting lost in the music. And when I’m flowing, I listen to five or more songs and can’t remember hearing them at all.

    • Alan Skorkin

      Yeah I know what you mean, that does tend to happen to me as well, sometimes when people talk to me I am so tuned into to what I am doing I don’t even realise for a little while, it’s like meditation almost :)

  • Ruben Zevallos Jr.

    I prefer to not listening music for coding or writing, but where I work, there are lot of noise and people talking, so that I have to shield my self with a trance or electronic music.

  • Dmitry Kandalov

    I used to listen to music while working in office. It think it helped me to avoid distractions such as other people talking on the phone. But after I started working at home (separate room and silence) I suddenly realized how much better I can program without listening to music.
    In noisy office listening to music is a trade-off between being distracted by music and noise in the office. I still think that some music genres are certainly better than noise :)

    • Alan Skorkin

      Hehe, you won’t get an argument from me there, I’ll take any music over sledgehammer next to window :).

  • text book rentals

    I like digital music the Chill station on Slacker radio without vocals. But I offten have the TV on and podcasts, it seams to keep my ADD to a minimum giving my distraction something to focus on. Allowing me to really focus.

    but I am not sure if I am just fooling myself.

  • TheDissenter

    Likely because I have played musical instruments my whole life, I cannot ‘listen’ to music in the background, since my brain forces it into the foreground thereby distracting me. However, there seems to be an exception that once the problem is solved and only coding remains, listening to classical music seems to make coding easier in a way I can’t really explain. So once again the usual answer is, it depends.

  • Miss Anonymous

    Sometimes it’s a case of no choice! I work in an office where the radio is played all day long with incessant chatter and distractions in the background. There is no escape but my iPod lol. Coding in silence is bliss, coding to background chatter is hell but coding with music makes the environment far more tolerable.

  • Karl

    I get distracted easily. I try to minimize the noise around me, when I engage in analytical activities, but that’s not always possible at work. No headphones = hearing loud boss on phone or someone talking about how horrible the system is coded (neither of which helps me with task on hand–analysis!). So I tend to stick my headphones on and have trained myself to treat it as background noise (which I can control and ignore). Given a choice I would prefer to have a very quiet environment (completely isolated from others) with very low volume classical music playing–wishful thinking! It’s not that I don’t like other humans; I just like them too much that I easily engage myself in conversations with them.

    So for now, my solution for noise is… well… more noise! :-)

  • Pablo

    I have found that when I´m listening a music that speaks in another language tha I understand, or, the music play so fast or is very distorted in the voice of the singer (and in all cases, my brain can’t follow the lyrics of the music) I can code and study wihout problems, the same as if I’m not listen a music, with the contradistinction that when I’m listening a music I enjoy more coding or studing, so when i’m not listening can do the same, but I get be more bored in a minor unit of time.

    That is the conclusion that I have from several years as programmer.

  • rent textbooks

    Honestly it all depends on the time/place/mood I’m in…

  • Pingback: Music « SerendipityandMe()

  • passingby

    no music! it ok to have people talking, turn on tv, kids screaming, dog barking…etc but no music of any kind. i can not concentrate with music around me.

    design work:
    i can do it with or without music, but with music i can do it a lot better. it doesn’t matter tradition or digital art, music help me a lot. but! i can not do it with people around me, no tv too. the room need to be quiet or with only music.

    (am main working area is a designer, but i can also do some front-end coding.)