4 ms·
Assuming you're a programmer working on software, the best way I've found to keep focus is to set up your development environment such that a) it's full screen
by perrygeo 4y ago
Assuming you're a programmer working on software, the best way I've found to keep focus is to set up your development environment such that a) it's full screen on a big monitor without any other apps or notifications and b) the feedback loops are as tight and automated as they can be - as soon as you hit save, automatically run the tests associated with that portion of the code. This has the effect of "gamifying" the software development process - every change is filled with the anticipation of how the test will respond. I haven't measured such things but other commenters mention dopamine and I suspect that a tighter development feedback loops produce more of it, allowing you to keep focus.
More generally, I've found that blocking off calendar time for "deep work" is effective if you commit to a plan for each time block. Before starting, I define what I'm trying to do and what the outcome would look like if successful. The first step is always to write a test that measures success in that context - it does not have to be a unit test or even something that you commit, can just be a simple curl command or bash script or a "I hit refresh in my browser and I see the image". Then I iterate until the test passes or time is up (generally because there are bigger issues)
And finally don't be afraid to engage in social media or games or other distractions - but do it in a mindful way. I use time in between deep work sessions to chat with friends, browse HN, write long rambling comments on HN, etc. You have to allow yourself idle time but keep it well and truly separated from deep work.