Like many developers I often put my headphones on when coding. It helps me get in the zone, block out other distractions and get into that flow state.
Not all types of music helps me though. I find what works for me best is listening to instrumental albums, particularly progressive rock/metal. The tracks feel structured and often flow nicely.
And the flow is not just on a track-by-track basis. The whole album just flows and, as a result, so do my thoughts. So I don't play these on shuffle (who plays albums on shuffle?). I also occasionally play them at the gym too!
Below is a list of my favourite instrumental albums to listen to while coding. And here's a Spotify playlist containing them all.