Same. When I have to seriously think about the code I'm writing - I stop the music. I think that goes against a lot of people who continuously jam music while writing code.
I don't mind music when the work is mundane, but I fucking hate needing to have something playing to drown out the sounds of people around me when I need to really think (best done in silence or with cafe noise for me). I honestly don't know how people actually do hard things in an office.
3M - Peltor earmuffs/noise cancellers. I got two pairs of them, one next to the desk, one next to the bed. Anytime there is any noise that I cannot control, I put these on and (almost) everything goes away. After 30 seconds I only hear my heartbeat, and that 'goes away' after 1-2 minutes giving me (almost) total silence.
At $20, it is the best one I've tried. It is not 'active' (mic filtering & speakers), it just has good foam tech.
Oh, I tried these last year. I'm glad they work for you and I'm sure for others, but it didn't work for me. The size took a little getting used to in an office, but that was fine. They just didn't work to completely remove the eating sounds that my coworker was making on our code assembly line.
I usually have music playing when I work, but when I leave the zone I often realise for the last 30 minutes I had headphones on for no reason, as the playlist finished :-)
It sounds absurds. But I think some may do the same.