DEV Community

Should You Listen to Music While Programming?

Claudio Bernasconi on May 04, 2019

Do you listen to music while working on your programming project? Is it okay, helpful or a bad idea? Are you an enterprise developer and are you ab...
Collapse
 
elmuerte profile image
Michiel Hendriks

Silence. That's what I prefer.

I only play music when I have to cancel out other noise. The music I play is generally music from video games. This music was designed to be supportive of the environment rather than being in the foreground.

Collapse
 
lkreimann profile image
Lea Reimann 🦄

That's a great idea!

I have a very noisy environment at work which makes it hard for me to concentrate. Since I'm a total metal head I tend to listen to this stuff at work but it distracts me a bit too much. I'm going to try music from video games to listen to at work soon!

Collapse
 
doubleedesign profile image
Leesa Ward

I'm also a fan of film/TV scores for this.

Collapse
 
cameronblandford profile image
Cameron

I’ve always been a huge fan of brain.fm. It generates ambient music that helps you focus and it works bizarrely well. However, it’s definitely a little draining in a way that listening to your favorite soundtracks isn’t!

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

I've never heard of brain.fm. Thanks for sharing. I might give it a try to see if it's something for me.

Collapse
 
edwinthinks profile image
Edwin Mak

Double up on brain.fm. One thing I really enjoy about this product is the music has a timer 30 mins, 1 hour, 2 hours. I utilize the timer to prevent myself from overworking and remind myself to take breaks =).

Collapse
 
israelmuca profile image
Israel Muñoz

It totally depends on what I'm working on...

New/Hard tasks

  • Videogames music (TLOZ!)
  • Classical music
  • very soft House music

Repetitive/easy tasks

  • Whatever playlist even the ones above

So I guess it all depends on the tasks for the day...

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Appealing thought about when to listen to which genre. Great idea, thanks for sharing, Isreal!

Collapse
 
chatziiola profile image
Lamprinos Chatziioannou

Read a couple comments that highlighted the use of YouTube music while working... It seems to me that listening to YouTube, even though it gives you an infinite selection of songs, is not ideal, primarily due to the lots of advertisements. I am a high school student and I am sure that I do not spend as much time coding for personal projects as the professionals here, but still, many times I have found myself suddenly distracted by an annoying ad playing over and over again.

Also, I have some doubts on whether listening to your favorite artist is something that should be avoided while working;catching a phrase and clearing your mind for a couple minutes is an interesting recipe for increasing productivity...

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

I also think that YouTube is not the best solution for me, but if it works for others - why not? I also believe that the ads can distract and, depending on the playlist you find yourself skipping songs a lot which means distraction from your primary task.

Yeah, I most of the time do not listen to my favorite artists while programming. Again, this is personal preference, and I love reading all the comments about how people approach their programming sessions.

Thanks for sharing your thoughts, Lamprinos.

Collapse
 
chatziiola profile image
Lamprinos Chatziioannou

It was my pleasure, Claudio, loved the article and the discussion that it sparked! 😉

Collapse
 
nelo_mf profile image
Manuel Fernandez

It used to be very effective for me, but now I've realized that I spend more time than i'd like switching tracks on Spotify.
I usually turn on the music when i'm feeling a bit tired and i've already reached my coffe limit for the day (which is two mugs a day if you're asking).

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

In my opinion, when using services like Spotify, the end goal should be that you don't have to skip tracks anymore. There are excellent algorithms which should learn what you like and what works for you. The longer you use a particular service, the better the song list should become.

Do you experience something else or do you agree?

Collapse
 
nelo_mf profile image
Manuel Fernandez

Totally agree, somehow the suggestions I get from Spotify are a bit flawed. Guess I should listen to more Spotify radios and actively like and dislike songs in order to "curate" my library... but my manager would choke me with my own headphones cable hahaha

Collapse
 
strahinjalak profile image
Strahinja Laktovic • Edited

I like to listen to techno and trance for getting in the "zone" that you mentioned, and it could really put me through hours of work without me even noticing. There are days when I'm just tired and could enjoy ballads. When there is something to be solved, that requires my full attention, I turn off the music, however, I might just keep the earphones on. :)

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

It seems like you are very aware of how you use music while programming. Glad to hear that is works out for you.

Collapse
 
strahinjalak profile image
Strahinja Laktovic • Edited

Yeah, thanks. Actually i really like your topic and I could go on and on about it because i was experimenting with the music a lot during work hours, first at school, college, and now at work. There are dozens of genres, playlists and types of music that I like and use in such manner. However that requires its own discussion and I don't want to bother you with details. I'll give one interesting example, however, since we are on topic. I used to listen liquid drum n bass playlists only while practicing for math exams, can't seem to remember i played it a lot during work :)

Collapse
 
theboxfactory profile image
Ian Clark • Edited

I find listening to music very helpful, but would make a couple of observations:

  • Music without lyric seems to work best for 'flowing flow' with slower paced electronica, ambient and classical proving popular choices

  • Playing music at a volume where it is noticeable by it's absence and not by it's presence, will also help you attain and maintain deep concentration.

Recommended Sources:

Music For Programming - musicforprogramming.net - Excellent electronica mixes
Generate FM (generative.fm/) - Generative ambient (includes open-source code!)

Collapse
 
fhammerschmidt profile image
Florian Hammerschmidt

Depends on my mood or if I really need to concentrate. I often start with youtube.com/watch?v=RYDUQx0iIN4 to get in the zone. After that, anything instrumental works, mostly electronic things like MDK.

For refactoring, I really like things like the DOOM 2016 soundtrack, just cutting through code instead of demons.

Collapse
 
damcosset profile image
Damien Cosset

I usually have two things that seem to work for me.

  • The first one is to pick a song, doesn't really matter which one it is, and to just listen to it on a loop. After 10 minutes, the song is just so repetitive that I don't pay attention to it anymore and I'm not distracted by the outside world. It seems to act as a white noise.
  • The second thing is classical music. Like you said, no lyrics might be better. I don't quite know why, but it seems to be the best genre for me when I want to get coding.
Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

There has to be something about classical music. You're not the first and undoubtedly not the last one to bring that genre up when it comes to focusing on programming work — excited to see that it works for you!

Collapse
 
mnlwldr profile image
manuel

I prefer music while coding. I switch between somafm's groove salad, defcon radio and Deep Space One station.

somafm.com/groovesalad/
somafm.com/defcon/
somafm.com/deepspaceone/

I made me a little bash script to switch between stations:

somafm

GitHub Gist

Collapse
 
seanmclem profile image
Seanmclem

I keep seeing: listen to songs with less lyrics, and listen to 1 song on repeat. However, what I sometimes do is listen to the same 20 songs with lyrics every other day or so. Eventually they get repetitive and it doesn't matter they have lyrics

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

I also have playlists which feature the same songs over and over again. I think listening to new music can also be a good thing. It depends on the situation, I guess. Thanks for sharing your thoughts, Sean.

Collapse
 
jacobmparis profile image
Jacob Paris

I spent a few months trying out different music streaming services and eventually settled on Google Play Music for their library size and compatibility -- however I did find that Deezer's Flow had the best predictive song algorithm.

If I need to focus on the music, it will distract me. Music I'm familiar with notably improves my performance. Listening to white noise is commonly prescribed to ADHD sufferers to help them focus and I once read a study that said listening to the same song on repeat had similar results. I believe this is the same effect that gives showers magical idea-generating and problem-solving abilities.

My personal rule is that if it requires focus and thought, listen to music. If it's just mindless autopilot work, listen to an audiobook and learn something.

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

"I believe this is the same effect that gives showers magical idea-generating and problem-solving abilities."

It seems like I'm not alone :-). Thanks for sharing your thoughts on the topic. There is no bulletproof solution which works for everyone. It's great to hear that you found something that works for you with Google Play Music.

Collapse
 
jmervine profile image
Joshua Mervine

I used to listen to Audiobooks while working in thing I didn’t find particularly stimulating or challenging (e.g. Rails, no troll intended). Fortunately I haven’t done that in a while.

I don’t like listening to music when I work (even doing dishes and the like). Personal preference that drives my wife and kids crazy. 😝

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Audiobooks are a great thing when you have to do work that does not need your full attention. I also sometimes listen to informational audio content like audio books while doing tedious tasks.

Glad to hear that it works for you as well. Thanks for sharing your thoughts, Joshua!

Collapse
 
glennmen profile image
Glenn Carremans

Most of the time I don't listen to music because I don't like to be cut off from the rest of the office, downside is that I am distracted a lot.
However if I am working on something new or with a tight deadline I put on my headphones and dive in the code. I use Spotify, press play and it will go for hours without me needing to change tracks.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I prefer music, for a few reasons:

  • it keeps me focused on my work. If there's nothing else occupying my mind, it tends to wander in between lines of code. The music is a constant backdrop. I have enough space for code and music, nothing more.
  • it relaxes and energizes me. I tend to alter the genre based on what I need more at the moment.
Collapse
 
doubleedesign profile image
Leesa Ward • Edited

I used to struggle without any music but I think that was because of other environmental factors. These days, I find music in the office irritating, probably because I don't have complete control over it - I do have some, but others get to choose what to play too of course... and at what volume (the latter is particularly a problem if I choose to put headphones on to at least listen to something I prefer - but may have to have it too loud to drown out the other music).

When working on something really interesting that requires a lot of concentration I usually prefer silence, but if it's something, well, boring, then music or something else to listen to can help eliminate distractions.

I echo what others have said about classical or other lyric-free music being helpful. When I'd prefer silence but can't have it, this is definitely the way to go.

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Thanks for sharing your thoughts, Leesa. You might want to take a look at noise canceling headphones. They should help to listen to music to a volume level you're feeling comfortable but at the same time eliminate outside environmental noise.

Collapse
 
steventhys profile image
Steven Thys

I listen to music often when coding but (like some others here I see)

  • Silence is preferred
  • Only music that has no singing/voices in it, as spoken text/lyrics distract too much an requires too much brain power to 'listen' to it, while the more monotonous /electronic music like techno or goa can get me into a flow state, also noise or other brain entrainment tracks work well for me for that flow state
  • If left alone I don't need music though and rather code in silence most of the time, but if there is too much noise around, people having 'meetings' from their desk, the headphones go on quick
  • coding with headphones on works well to have people not disturb you all the time, I might even not have any music on, just the headphones, only for that reason :)
Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

YouTube has a lot to offer for sure. But I share your opinion that it's hard to find really good long lasting compilations. Some of them are repetitious. Nonetheless, a great tip that could help some developers. Thanks for sharing your thoughts.

Collapse
 
samjakob profile image
Sam (NBTX) • Edited

I tend to concentrate really well for long periods of time but I kind of have to 'point' my brain towards what I want it to focus on, I find music helps me to isolate myself from the other crap going on. 😂

In my case, I think pretty much any music works for me, I just find something on YouTube Music and let it automatically play the next track but if I have a particularly hard challenge to solve, I do sometimes have to pause the music and talk myself through the problem though.

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Sam, you seem to be in a very fortunate situation if you can use "whatever you like" as your music while programming. Take this advantage. Staying focused on a task is hard. You seem to deal with it with ease.

Collapse
 
kriyeng profile image
David Ibáñez • Edited

Great post Claudio!

For me, definitely yes!

I like to think regularly how music helps me to get into the right mood.

I think music allows me to create the correct mood for the work I need to do, adjust it a little or keep that mood I'm already in for long time.

For me the point is to pick the correct music for the correct task and the mood it requires. I have some playlists prepared to do the job.

I will choose my playlist depending on:

  • The mood needed for the task
  • My current mood

I'll pick the correct playlist to move my mood from the point I'm to the point I need to be.

If I'm so excited or anxious and I need to do a high decision tasks, I need to calm me down, some chilling music will do the job like solo piano calm songs, If I some sleepy but I need to have things done, some electronic will work great!

Sometimes is not possible for me to jump two steps of mood at a time. I need to play some in the middle for a while and after some time go for another step.

Related to types of music, instrumental music works very well for me and more lyrics songs only if I listened so many times that my brain doesn't pay attention to these lyrics.

And there's another thing that works very well for me. Silence! There are times that silence is the only thing that works for me!!

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

David, thanks for your detailed comment on how you deal with music and especially how you leverage music to transition from your current mood to a more productive mindset. Very inspiring comment.

Collapse
 
gilblinov profile image
Gil Blinov • Edited

Something no one brought up in the comments: White/ Brown noise.
Cancels environment and puts you in a zone.

For me (it differs on the task):

  • White/ brown noise
  • Rain soundscapes (not much rain here, I have to make do)
  • Video game music
  • Tron Legacy OST
  • Dance-to music (Hip-hop, 80's, latin, etc.) - I have a standing desk and it helps to be active.
  • Symphonic Death Metal (usually for the time sensitive tasks. Incl. Headbanging).
Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Thanks for sharing those alternative ideas, Gil. Very much appreciated!

Collapse
 
mccurcio profile image
Matt Curcio

Do what you please, just please wear headphones. ;)

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Of course, I wear headphones. I dare you to use speakers when I'm around ;-).

Collapse
 
mccurcio profile image
Matt Curcio

I never wear headphones. I wear those protective head sets that jackhammer workers use. ;)))
-Oh, we're you speaking??-

Collapse
 
umitic profile image
Uros Mitic • Edited

Silence or if that's not possible then sound of this(White Noise) in my head phones:
youtube.com/watch?v=ArwcHjmsw3A&t=...

Collapse
 
sarim profile image
Sarim • Edited

Led Zeppelin baby! I like to listen to rock when I don’t sleep enough for a day (and also in general). Other times I would listen to Lofi and ENAwave, a genre created simply from the bizarre creation of Joel G’s ENA from YouTube :)

Just earlier today I had a near 2 hour session fully devoted to code with Led Zeppelin playing the whole way 🤘

I usually have all my music downloaded with youtube-dl so as to listen with high quality and without relying on the internet to stream my music for me. I’m the type that likes to recycle their music/listens to a genre/artist/album on repeat, so this approach is best :P

Collapse
 
lukewduncan profile image
Luke Duncan

It seems counter intuitive but I manage to find myself in the zone when I'm listening to heavy rap music e.g. Freddie Gibbs, A$AP Mob, Schoolboy Q.

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Whatever works for you is best for you. Thanks for sharing your insights.

Collapse
 
itr13 profile image
Mikael Klages

From what I recall, studies have shown that it's harder to study when listening to music with lyrics, so something similar might be true with programming.

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Scientific studies are important, and my article undoubtedly has zero scientific value, but it acts (in combination with many great comments below this article) as guidance to success. If you work better without music, you should stick to it. I do not have any hard feelings about that.

Collapse
 
sm0ke profile image
Sm0ke

/programming/stuff 2>&jazz

Collapse
 
pinotattari profile image
Riccardo Bernardini

"There is no right or wrong. There is no yes or no. If it makes sense for you to listen to music while working, you should do it. Some people will benefit, others don’t."

That nails it.

Collapse
 
claudiobernasconi profile image
Claudio Bernasconi

Thanks for sharing this feedback with me, Riccardo. Glad we're on the same page.

Collapse
 
evankapantais profile image
Evan Kapantais

Our God: lofi hip hop radio - beats to relax/study to