"For a long time there’s been a fad in our industry of having open workspaces. While being right next to someone and being able to just look over and ask a question is ideal for communication, it can be the opposite for concentration. Headphones with loud music don’t solve the problem either. What I believe works best is quiet. Can you imagine taking a final exam in college with someone blasting music? You can’t concentrate at your best when any sort of external stimuli is demanding some of your attention. It needs to be quiet, and free of any visual distraction as well. People walking by, a television, anything like this should be avoided for you to stay in the zone."
Via HN. Strongly concurred with the poster on the important of elimination of distraction for a programmer. Even blasting yourself with music is also another form of distraction or a substitution of your environment noise. Any programmers who claim that they are productive in a open floor plan office is just plain bullshitting. As the example of taking an exam shown, any cognitive activities needs absolute zero or minimum distraction. That why some of us is far more productive after working hour or during midnight.
On a related note, besides optimizing your daily routine as a developer, you need to take charge of your programming career and be responsible of your learning and health, especially when you're over 35-years old. At this second phase of your career, priorities changed as time and stamina are limited resources. There is only so much you can do within this lifetime, minus all the sleep, rest, idleness, or procrastination. Focus on learning new stuff to sustain that programming passion. Unless necessary, stop working on the same stuff years after years (same technology stack but different business domain), do something new, take risk, even if might affect your bread and butter.
In short, stay healthy, stay relevant, and be a generalist rather than a specialist. Open yourself to different programming languages or paradigms. Find a way to sustain your love and don't starve yourself along the way.