I coded from essentially an open warehouse for several years with shop noise, sewing machines, various noise generating machines, packing tape noise and people. Talking on the phone was difficult, let alone CODING. I honestly feel like I might have some noise sensitivity complex from working in that environment for so long. Tried not to complain, but my noise cancelling headphones were the only thing that allowed me to be productive. I eventually got an office and that helped considerably. I don't work for that company anymore.
I work from home now and it is the opposite spectrum, I get total piece and quiet, I love it. I can't say enough about a good pair of over the ear noise cancelling headphones though if you find yourself sensitive to noise.