If its a technology I'm not great with (most things these days), I usually need to learn as I code. And since I do my best learning in silence, thats what I go for. But programming with a familiar framework, I'm fine with whenever and whatever except silence; need some background white noise. I usually DON'T use music for white noise (I get distracted because I know the songs), preferring instead a lounge, cafe or a 7/10 movie playing in the background.
I've been working on an iOS contract job for the past two weeks. I wrote at home in silence as I knew very little of the features they asked me to implement (using vDSP, MapKit, GameKit, Remote I/O Audio in conjunction). I went to client location only to put finishing touches/last minute addons/testing. (Client Location wasn't exactly geared for a productive developer environment - too much noise, too many distractions)
Turned out to be great app - they loved it and it taught me a lot about iOS, DSP, and my working preferences.