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 songs back then. From AC/DC to Eagles, Bon Jovie to Led Zeppelin, and Metallica to Guns N Roses, I used to have my phone loaded with hundreds of rock ballads.
I was quite obsessed with rock and roll. It used to be a source of dopamine to me. I used to get motivated and energized by those songs.
Now the time has changed, there has been a shift of paradigm. But the love for music is still the same. Starting my day with a simple workout with beast mode workout music is my hack to keep myself motivated to do more exercise. Even during the day while programming, I mostly wear headphones to keep myself focused and to stay away from disturbances.
But a few months back I stumbled upon an article online explaining why listening to music while coding is not a great idea. The logic is that when you are coding you are using your energy on different things - staring at the screen, solving a problem, and listening to music. You are losing energy through the eyes, ears, and, brain. You cannot close your eyes and neither you can turn off your problem-solving background job. One thing you can do is stop listening to music.
I advise using noise-canceling headphones if you want to get rid of background noise. Avoiding music while coding will help you put more energy into solving a programming problem and will make you more productive. If you do not agree with me yet, think about why people meditate with their eyes closed? They save energy doing so; which helps them to use that energy in the brain.
Trying to solve every algorithmic problem in O(logn) is not only the trait of a good programmer, trying to optimize your everyday algorithm crucial too.
Top comments (115)
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 ;)
I love lofi bits so much
Even i do
Hi MilMike thanks for sharing your preference. I will also give it a shot.
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.
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. :) :)
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.
I also love listening to Heavy metal, currently Architects band. Thanks for sharing Michel
Hi Michel thanks for your comment. I agree not everyone is the same.
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
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 (・`ω´・)
That's correct Nino. I agree with you
Exactly Nino.
I guess everyone has different habits, some might perform better with music, others not so much.
I myself need silence, hence I'd never work in a crowded room, two people tops, no phone calls or phones ringing, no music.
Allow me to chime in here (pedantically, I admit):
That statement is a bit misleading. I'd say a good programmer knows how to spend their time efficiently. It's not like solving performance problems with O(log n) doesn't usually come at a cost.
I'd argue in many cases our everyday code doesn't pose relevant performance issues, and thus doesn't need any optimization.
If optimization is required, most of the time we need to find a solution that is good enough, which in many cases is still far from O(log n).
After all, optimization is usually expensive.
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. :) :)
Thanks, and I fully agree!
As long as you add Bryan Adams to your playlist, we're okay 😝😅
haha sure will do Sebastian. I love his songs too
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.
cool
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
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.
Cool. Thanks for sharing Whaison
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.
Cool. Thanks for sharing this knowledge Remi
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.
that's true doma.dev
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.
Ya similar case for me Daniel.
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 .
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.
ya that's right :D
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.
That's right. It seems lyrics heavy songs are not good while coding. Thanks for sharing Abhinav
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.
That's true Anthony
Some comments may only be visible to logged-in visitors. Sign in to view all comments.