I'm biased, being a musician, but my experience and many of my colleagues is that musicians are often excellent coders, and I credit this to the fact that you need to master your attention to become a good musician. There is no other way than getting good at putting yourself alone in a room with no distractions and practicing in a focused manner. I remember when I hired a friend of mine (pro bass player) as a junior coder and it was so obvious watching him learn.
Personally my top tips for getting better at attention management would be:
- Take up an instrument or some other hobby involving regular, quiet, uninterrupted, solo deliberate practice. Do it daily. It becomes your rinse cycle.
- Adopt the pomorodoro or other similar technique of doing 20-30 minutes of completely focused, uninterrupted work at a time and then taking a real break for a few minutes. This is both how I work and practice.
- Read a lot, on paper.
- Run - IMHO way better than lifting for overall mental effects and mental focus
- Get enough sleep, religiously
my two cents Canadian. :-)