One thing that proved to be a stumbling block for me (and I was surprised by this) was finding the right music to code by. Total silence is a little difficult. I have my favorites for other activities, but none of that worked for me (not even Kraftwerk, which one would think tailor-made for programming. Alas).
I did manage find several artists that really helped me focus: Stellardrone, Distant System, Aes Dana.
What music helps you focus to write code?