First off, I've got to have music. Depending on how the coding session is going I'll pick an appropriate playlist ranging from early Type O Negative to Johnny Cash and Marty Robbins. Listening to music that I actually pay attention to is not a very big distractor for me, and it often helps. Sometimes I'll be stuck at a problem, and I'll just jam out at my desk to a song and jump back in refreshed.
As far as physical environment, I prefer to have the lights off, except for a reading light. Lots of desk space is a must so I can organize my various books and printouts.
I've found that a beer or two usually helps me write (interesting) code. I've also learned to never write comments while drinking. I've still got some code that I have no idea what it does, and the comments look like they're written by the Swedish Chef.
As far as least favorite environments, it would have to be sitting next to my cube mate who takes great delight in interrupting me every ten minutes to show me the newest TV ad he's found on adcritic.com. rrrrr
GuildensternNegaterd character class uber alles!