When coding I usually only listen to music if it's an album that I have listened to at least 5+ times. This works for me in that my brain seems to know exactly what parts/songs are coming next and they are no surprises/distractions.
Mixes and things like last.fm are no good because I always have to stop to see what is playing.