1. Distractions are not always bad. Given the number of hours devs can work, sometimes a short distraction is healthy.
2. Every developer knows to invest a good set of noise canceling headphones in an open office. This allows you to be in 'heads-down' mode and your coworkers know not to bother you unless it's work related.
about headphones - i hate these somehow. I am ok to use these while riding bike, when I wait in line, or working in coffee shop, but nothing is more pleasuring and actually helping concentrate like closed office with speakers playing Infected Mushrooms.