DEV Community

Cover image for Should I listen to music while coding?

Should I listen to music while coding?

poudyal_rabin on March 23, 2021

When I was a teenager, I used to be a die-heart fan of 80's rock and roll music. I had maintained a handwritten lyrics book of all popular rock son...
Collapse
 
milmike profile image
MilMike

when I code and I know what I am doing I listen to fast paced music, I prefer music without vocals mostly I listen to fast Hardgroove Techno.

When I am thinking about a problem and trying to get a solution I listen to slower paced coding music (you can find them on youtube). Or just silence. As you mentioned noise cancelling headphones are good, even without any audio, just silence.

But once I have a solution or a specific todo, I go to turbo mode with techno ;)

Collapse
 
developeratul profile image
Minhazur Rahman Ratul

I love lofi bits so much

Collapse
 
devparkk profile image
Dev Prakash

Even i do

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Hi MilMike thanks for sharing your preference. I will also give it a shot.

Collapse
 
pierrelampre profile image
Justin Lampe

Here has been my process thus far in regards to music choices while coding.

If I am doing tasks I do frequently, I can listen to any kind of music and be productive. But if I am grokking something rather complex, I will opt for instrumental music. I really like Rachmaninoff and Debussy. I also like vaporwave and dreamwave in these situations as well. Shameless plug If youre asking, "Whats vaporwave/dreamwave?" here is a dreamwave album I released with a friend last year:

ttime.bandcamp.com

There are also moments where I appreciate silence, but its not always an option. With the pandemic my girlfriend is often working from home in the same house as me and a lot of her work is doing zoom calls with clients and verbally walking them through things.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Hi Justin! Thank you for sharing your opinion. You are absolutely right. Most of the time we need to find the fine balance between if we want to play music or not based on the task we are into. :) :)

Collapse
 
ninofiliu profile image
Nino Filiu

Well it depends on the mode

In creative mode, I solve complex issues that require all my focus. I shut down my music and give all my brain can give, but I can't maintain this state for 30+ minutes

In productive mode, where I code large chunks using techniques I already master. I don't need that much focus and I love having minimal techno/trance in the background, that's necessary for me to enter the flow state and stay there for hours

Collapse
 
ninofiliu profile image
Nino Filiu

There's also the impact of the genre on the code I produce

If I listen to long minimal techno mixes I'll be able deliver massive amount of code and stay in the flow state for a long time

But if I plug some ambient electronic music I'll be able to get very creative in the patterns I use and code things I couldn't code in a silent room

And if I listen to hard eurotrance I'll be able to sit through coding a feature I don't like (・`ω´・)

Collapse
 
poudyal_rabin profile image
poudyal_rabin

That's correct Nino. I agree with you

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Exactly Nino.

Collapse
 
metalmikester profile image
Michel Renaud

I've been listening to music while working since the '90s. Heavy metal music.

If there's no music, I freak out. I'm also treated to construction noises, street noises (a**holes with aftermarket mufflers, emergency vehicles (fire station AND hospital nearby), barking dogs, etc. "Silence" is not a thing here. I also cannot wear headphones if there's nothing coming out of them just for the sake of trying to block external noises. I never even liked headphones. A major advantage since the apocalypse began is that I'm home and don't need to use headphones.

Some of my most productive algorithms work in university was done while listening to Motörhead.

There's no link to that article you mentioned, but I can say this:

Not everyone is the same.

Collapse
 
nhatnguyentim profile image
Hoang Nhat

I also love listening to Heavy metal, currently Architects band. Thanks for sharing Michel

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Hi Michel thanks for your comment. I agree not everyone is the same.

Collapse
 
m3hdi404 profile image
Mehdi

You can use binarual beats to increase productivity of your brain. Base on the situation you can use Gamma waves binarual beats for highest brain function and problem solving or you can use alpha waves binarual beats for more focus. Just read about brain waves and use the best binarual beats. Or either you can use 432 hz frequency(frequency of nature) it's very relaxing and good for increasing brain function.
But if you want to use your highest brain function, just use Gamma waves binarual beats when you are coding and every 30 minutes, relax on bed and play 432hz music for 10 minutes. It's really affect your brain function.
You can find binarual beats and 432hz frequency in YouTube.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

wow thanks Mehdi. I did not know that

Collapse
 
whaison profile image
Whaison

I have tried coding with melody heavy music in the background, but that didn't work for me. I would always focus more on the music than on the coding. Now I'm listening to lofi. The steady beat keeps me focused whilst not being a distraction. The music blends into the background and sometimes I don't even realize that it is even there.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Cool. Thanks for sharing Whaison

Collapse
 
eelcoverbrugge profile image
Eelco Verbrugge

This is personal. I'm getting into the 'zone' more easily by listening to music without vocals. Especially music (sets) I've already heard 10 times plus. If the song/set is new or including vocals, it does distract me indeed. Like

Collapse
 
studiospindle profile image
Remi Vledder

Cool that you had handwritten lyrics! Most of the songs I listened to were in English which isn't my native language so listening what was said came at a later age :P.

During coding songs with lyrics and sudden noises (AC/DC :P) are distracting. But what helps me concentrate more are more monotonous (in a good way) albums. Such as for example "Tripping with Nils Frahm".

Also what is interesting is the research that shows: "A moderate level of ambient noise is conducive to creative cognition."

It's from the website coffitivity which has options to set background noise just as if you are in a cafe.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Cool. Thanks for sharing this knowledge Remi

Collapse
 
frondedaniel profile image
Daniel Fronde

Thanks for this post.
When you are in a noisy environment it is true you can become less and less productive.
I used to do programming around 4h am when everyone is sleeping and the world around is quiet and I solve problem quicker, with more efficiency at this time.

But we can admit that people are little bit different, that can happen a background-music help someone else be productive 😉. But in my case I think it's quiet environment, like that I can put all my focus on the problem.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Ya similar case for me Daniel.

Collapse
 
doma profile image
doma.dev

Agreed!

Some people spend years coding to music to then realise how much productivity they have irrecoverably lost.

Ambient instrumental music, however, can be OK for some people, but nothing that grabs attention.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

that's true doma.dev

Collapse
 
fluxthedev profile image
John

Yay music. I love music. I play it, I feel it, I breath it. But sometimes music makes me less productive. For instance, anything with words or instrumentals from my favorite songs, I cannot listen to and code, because my mind focuses on words and familiar melodies. I have found instrumental movie sound tracks to be my bread and butter when I need to focus coding for hours at a time (or 25 mins at a time if I remember to turn on my pomello timer ha!). Here are some of my favorites: Tron Legacy by Daft Punk, Interstellar Movie Soundtrack and Social Network Movie soundtrack.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Thanks John. Ya I totally agree on the tradoff we need to make for productivity. :)

Collapse
 
thebenforce profile image
Ben Force

Since I started working from home I've stopped listening to music, but it was an invaluable tool when I need to concentrate with coworkers around. Also, I found that if I was really concentrating on the problem the music would "disappear" when I got into flow.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

thats right.

Collapse
 
aaronj profile image
Aaron Johnson

Hey , at least for me , I work better when I listen to chill music either indie or just acoustic , it helps calm me down and for me personally I am very productive when I’m very calm . So I guess that’s why indie and acoustic music helps boost my productivity .

Collapse
 
markokoh profile image
Mark Okoh

I prefer listening to unfamiliar music when I'm coding, rather than stuff I'm really into - it's less distracting. I find Music For Programming quite good for suitably odd, wierd, droany music to code to. I also really like the design.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Thanks for sharing Mark. Will try that one

Collapse
 
egilhuber profile image
erica (she/her)

I have different playlists for different coding situations. For the stuff that I could do in my sleep, I definitely jam out. For more intense work, something like Brain Food on Spotify or some binaural beats is better, lofi is also a huge go-to for me.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

cool

Collapse
 
alaindet profile image
Alain D'Ettorre

Music is only needed, for me, when noise from collegues is worse than vocals from songs

Collapse
 
poudyal_rabin profile image
poudyal_rabin

lol indeed

Collapse
 
jhilker profile image
Jacob Hilker

I personally can't work in silence. While I will usually turn on some Coheed or Tesseract, if I'm working on something that I keep getting stuck on, I'll turn on some instrumental music and keep going (Animals as Leaders and lofi are what I like to listen to personally).

Collapse
 
poudyal_rabin profile image
poudyal_rabin

That's cool. Good to know that works for you :) :)

Collapse
 
cswalker21 profile image
cswalker21

For me it's classical for thinking stuff, death metal for rote stuff and The Cure for debugging. ;) I know some people who blast their music while coding, but I just can't do that. It has to be very low volume, but I like it better than silence. YMMV.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

ya cswalker21 I agree

Collapse
 
andreidascalu profile image
Andrei Dascalu

I'm on and off about music. When I do tasks that don't require too much brainpower and are in fact more "grunt" work, I tend to put something close to my gym music, power stuff that gives energy and rythm.
Otherwise, I go between nothing and some classical music to inspire some creativity.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

cool. Thanks for letting us know Andrei

Collapse
 
jrecas profile image
JReca

I can't go with silence, I need to use something to keep my mind here. So I developed a library of instrumental math rock, fusion jazz and other things that have no lyrics at all so I don't listen too much.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

sounds amazing JReca. :)

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Hi Sebastian thank you for your insightful comment. I agree with your idea that the O(logn) thing is misleading. I was originally trying to give an analogy that real-life performance can also be improved. :) :)

Collapse
 
abhinav1217 profile image
Abhinav Kulshreshtha

I listen to soft EDM/ Eurobeat / Fusion mix at a low volume while coding, Since I work at home, It helps keep me focused by acting as white noise. I usually avoid new unknown songs or songs with meaningful lyrics because then it isn't in background anymore and I am listening more than coding. Therefore its an old playlist running at loop.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

That's right. It seems lyrics heavy songs are not good while coding. Thanks for sharing Abhinav

Collapse
 
codebymdb profile image
Michael Bonner

I can't have it too quiet so I do. I do have to be careful that my "jams" are playing while I'm in the middle of something otherwise I will either get too distracted or have to take a break until the song finishes.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

ya that's right :D

Collapse
 
elixirprogrammer profile image
Anthony Gonzalez

Whatever makes you feel comfortable. Sometimes I code while watching a movie or playing a video of any kind just having something playing in the background helps me relax, but most of the times I can't have any distractions when I'm completely focus.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

That's true Anthony

Collapse
 
abh1navv profile image
Abhinav Pandey

There are two types of music I prefer on work days.

  1. Stuff I can sing along - This is during the breaks when I need to calm down and distract myself from the work.

  2. Stuff I can't understand - This is when I code. It it great for concentration I believe. Wanting to sing along can be distracting for me if I really need to focus. So I prefer songs in other languages or fast paced raps which are hard to keep up with.

Listening to music is an essential part of my work. If not for any other purpose, it's great for noise cancellation.

Collapse
 
redhoodjt1988 profile image
Jonathan Reeves

I listen to music when I code. Whether I am learning something from documentation or just spending the day working on a project. I normally listen to heavy metal instrumentals. But occasionally I'll want to listen to something with lyrics.

Collapse
 
derekcrosson profile image
Derek Crosson

I used to like silence while writing code but sometimes I listen to music or binaural beats. I figured that constant notifications in Slack is gonna distract me anyway so I'll just keep listening to music :)

Collapse
 
johnminelli profile image
Giovanni Minelli

Biologically yes, you shouldn't do it, to concentrate your effort in a single sensory direction (source: course of Cognitive Neuroscience at university). Personally if i listen to something music/podcast i can code for many hours straight without being tired. However when the task is mentally hard, the total complete silence is the way for me.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

thanks Giovanni

Collapse
 
rishitkhandelwal profile image
Rishit Khandelwal

I would say don't, because I find it distracting whole coding. But it can be that ur more focused.

Collapse
 
augustasv profile image
Augustas Verbickas

There is a different variety of white noise, and it feels distracting at the beginning but later I get used to it. Also, it blocks outside noise better than some noise-canceling headphones. I used to work focused when I play white noise, so my brains know that it's time to focus.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

cool!! thanks for sharing Augustas

Collapse
 
poudyal_rabin profile image
poudyal_rabin

ya right Rishit

Collapse
 
marcandreappel profile image
Marc-André Appel • Edited
Collapse
 
poudyal_rabin profile image
poudyal_rabin

cool.

Collapse
 
wallesamehere profile image
Łukasz B.

I listen a lot productive sounds like fan or hairdryer. Idk, someone have the same like me ? :)

Collapse
 
bertmeeuws profile image
Bert Meeuws

Sometimes I feel like lo-fi is made for coding

Collapse
 
dskaiser82 profile image
Daniel Kaiser

If I need to think about solutions to a new problem, not as much. But if it's tasks I know I can blaze through I will.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

cool. thanks Daniel

Collapse
 
sdkfhjskldjfjkhsdhjkfd profile image
Gergő Móricz

Personally, music makes me work better and faster. I like to either listen to something that has a sort of 90s hip-hop style, or something super abrasive.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

cool. Thanks Gergo

Collapse
 
feliciaxml profile image
ANN

fk = O(g) ✨✨✨✨♾️♾️♾️♾️♾️♾️♾️♾️♾️♾️♾️♾️&&&&&__&&&&_______

 
poudyal_rabin profile image
poudyal_rabin

haha sure will do Sebastian. I love his songs too

Collapse
 
iainfreestone profile image
Iain Freestone

If its just music I am fine but anything with lyrics is a no go for me as I find I lose my concentration and start concentrating more on the song than my work.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

I agree Iain

Collapse
 
augustasv profile image
Augustas Verbickas

For me whitenoise work pretty well, so I could focus on what I am doing. And Pomidoro timer.
During a breaks music for sure to chill.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

hell yeah

Collapse
 
sandordargo profile image
Sandor Dargo

Yessss! Up the irons! 🤘🎸🤘

Collapse
 
poudyal_rabin profile image
poudyal_rabin

🤘🎸🤘

Collapse
 
elvisoric profile image
Elvis Oric
Collapse
 
poudyal_rabin profile image
poudyal_rabin

Thanks Elvis

Collapse
 
jadenconcord profile image
Jaden Concord

Your totally right about music being distracting but for now, I would rather have fun working than being more productive. Nice article!

Collapse
 
poudyal_rabin profile image
poudyal_rabin

thanks Jaden

Collapse
 
zodman profile image
Andres 🐍 in 🇨🇦

search on spotify: Hola beats.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

thanks Andres

Collapse
 
asyraf profile image
Amirul Asyraf

Lofi is my default. If the work is kinda not needed focus much, I tend to listen to funk or pop music.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

awesome. thanks for sharing Amirul

Collapse
 
offirmo profile image
Offirmo

Isn't it why we see all those "LoFi" soundtracks on youtube? They are less intrusive and should be a sweet spot between motivation and distraction.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

cool.

Collapse
 
rushannotofficial profile image
Rushan S J

Depends on you whether you want to listen to music or not. Listening to Fast paced, high bass EDM music, gives you energy to solve problems.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

:) :)

Collapse
 
sidcraftscode profile image
sid

As a UI designer, I don’t listen to any music while designing because it can affect how the end product. Listening to sad songs can make the UI look sad for example 😂

Collapse
 
poudyal_rabin profile image
poudyal_rabin

lol I agree

Collapse
 
meetbhalodiya profile image
b-meet • Edited

I think that not to listen to music while learning new thing but maybe it's good when we are doing usual things which we already know how to deal with.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

That's correct B-Meet.

Collapse
 
musicoding profile image
Roy Chen

Yesss! Actually my youtube channel name is music coding, you can take a look 😜 bit.ly/39g9MWs

Collapse
 
poudyal_rabin profile image
poudyal_rabin

haha thanks for sharing Roy. will check your channel :) :)

Collapse
 
marekozw profile image
.

Whatever works for you. E. g. I cannot remain focus while listening to music. In fact I never listen to music, especially at work.

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Ya that's correct. Me neither :)

Collapse
 
poudyal_rabin profile image
poudyal_rabin

haha, that's right Amelia. I also think lyrics-heavy songs should be avoided because part of the brain will start processing the lyrics. :D :D

Collapse
 
codemouse92 profile image
Jason C. McDonald

That really depends on the person! Some people are distracted by lyrics, while others (such as myself) are generally more focused with lyrics. It depends on my mood, but there are a lot of days that nothing focuses me better than rock. Other days, it's contemporary. And still other days, it's full-blown metalcore (Wolves at the Gate, yo!!)

Collapse
 
1bilal profile image
Bilal Lawal Alhassan

I find that listening to game soundtracks help me stay focused. The tune is designed to keep your brain engaged. I recommend the Halo and Titanfall soundtracks

Collapse
 
poudyal_rabin profile image
poudyal_rabin

Thanks for letting me know Bilal. Will try that one too.

Collapse
 
arunpratapsingh17 profile image
Arun Pratap Singh

any chilledcow fan here?😁

Collapse
 
poudyal_rabin profile image
poudyal_rabin

:D

Collapse
 
mohdahmad1 profile image
Mohd Ahmad

I think music a distraction while coding, I do not prefer listening to music anytime.

Collapse
 
curiouspaul1 profile image
Curious Paul

LO-FI

Collapse
 
mnkls profile image
mnkls

I always listen to Migos while coding

Collapse
 
cescquintero profile image
Francisco Quintero 🇨🇴

It depends.

Collapse
 
intermundos profile image
intermundos

Depends on you and you only.

I love coding with dub techno tones. Look for Drif Deeper channel on youtube, got large collection of sets.

Collapse
 
frulow profile image
Frulow

I don't want my background to be boring, so I play instrumentals, mostly. Only in rare and intense situations my background is silent while I code. Else there's always music.