Many people seem to be surprised when coders tell them that they work well while listening to music all day. Some people just assume that they listen to music to cure the boredom of sitting at a computer all day.
Speaking personally, I find it helps with concentration. By "immersing" yourself in music and blocking out every noise around you, it leaves your brain free to concentrate entirely on the work at hand.
It's also very interesting how different genres of music can affect your code. For example if I really need to "get something done" and power on through a project, I can listen to something like techno/dance music which gives awesome energy. Quite often I'll listen to something like ministry of sound
when in this type of zone.
Obviously you'd burn out quickly if you tried to code madly like this all the time, so when I'm working through a project at regular pace, I usually turn to more relaxing "alternative/rock" music which is quite energetic, but not overbearing. My pick for this would be something like Incubus
Alternatively, when I want to relax and think over things (perhaps solve a tricky problem), "chill out" music helps to block out surrounding noises, but leave plenty of room to think without any invasive music. Moby
is a good example of "chillout" music.
Feel free to comment back on what sort of music you listen to while coding or how music affects your coding!