Forget Pro-Plus or extra strong coffees, you don’t need this or a trip down to Spec-Savers to help keep focus. The answer is agile.
So what’s the answer. Maybe spend 3 years on a Tibetan mountain in deep meditation to improve concentration. Perhaps one of those herbal teas would work? Or maybe some form of lobotomy would prevent these lapses of concentration… To be honest, if I was able to give myself perfect concentration I would never remember to get my wife a birthday present. I think the real answer is to find a way to get back into the zone as quickly as possible once focus has been lost.
Here’s where agile helps. When working in an agile way, you are always working on a story. If you lost clarity about what you’re trying to achieve, you simply go and pick up the card, read the acceptance criteria again, and quite suddenly you’re ready to go again. Additionally, you’re only allowed to work on the story in-front of you, so you can’t be distracted by stuff outside the scope of the story.
Another valuable tool for regaining focus is cucumber. We write up a user journey in cucumber first, and if you forget where you had got to, all you need to do is run that feature and you’re told what to do next in big red letters.
So, in summary, an agile developer is better at retaining focus than a Tibetan monk… no really!