Lately I've listened to Angels & Airwaves a fair bit - fairly simple melodies, electronically pure, and while there's emotion there it's gentle and chilled enough to keep me relaxed.
Other days its a crazy spread of Sigur Ros, Porcupine Tree, Animals as Leaders, and Mars Volta.
Some days I just need silence. I know thats a lot of name dropping, but it hopefully shows the overall spread that qualifies my least favorite statement: "It Depends"
If I'm doing more contemplative work and the surroundings are quiet, I'll go without.
When working in an open floor office (which I hate when coding) then I fall back to white noise or ambient music in combination with a good noise cancelling headphone.
- Oblivion credits song
- Massive Attack - Teardrop
- Royksopp - What else is there?
My biggest pitfall I have when coding is that I get into victory-dance mode when I get something new working and it distracts me to the point where I get less done. By running a slightly sad music library I can stay grounded in good times and intrigued in bad.
But I've getting back into grime, garage and acid house lately through Rinse FM: http://rinse.fm/player
During the day I generally listen to country. In the evening I switch to classical music and for late late nights - hard rock/metal.
Sometimes during the day I'll put my headphones on just to drain out excess noise - even though I'm not listening to anything.
Otherwise it's more groove heavy DJs like Flying Lotus, Four Tet, Caribou, etc.
If it requires mental focus; Ratatat, Amon Tobin
otherwise; Steve Vai, Dio, Pink Floyd, XYZ, Led Zeppelin, Mezarkabul, Bulutsuzluk Ozlemi, Baris Manco, Erkin Koray, Cem Karaca etc.
Nothing when it's going shit ;)
http://i.imgur.com/BEglNuP.gif
As to what kind of music, some tunes by Calyx & Teebee or Ed Rush & Optical seem to do the trick for me, and other music "in that style"... hard for me to answer precisely without spamming youtube links, since I like individual songs, never artists or genres as a whole. Well, except just about anything by Skeewiff that doesn't have lyrics, which is an entirely different mood, but works great for pretending I'm an Austin Powers style secret agent :D
When trying to solve a problem that's new to me, I usually do best in silence, and if that fails I need a shower or a walk. So yes, for me music (or movies, radio, anything really) is a distraction, but sometimes I find that distraction from "chores" while doing them very helpful indeed. I'm not a great and never a groundbreaking coder, so such chores seem to make up the majority of my coding time.