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.