I've been using a tabata timer (used for timing workout intervals and rest periods) for programming for a few months combined with other elements below with good results.
I do 6 sets of 15 minutes each with a 30 second rest in between. This ends up with 90 minutes of coding time per session. Goal is to do at least one session each day first thing in the morning.
Here are the key elements of my current setup:
01 Block distractions
I setup my browser to block all distracting sites - including email. You can use browser extensions or desktop apps for this. Most allow you to block certain sites for certain times during the day. So you can set it up once and forget about it.
When it comes to distractions I keep this principle in mind: don't try to change yourself, change your environment!
02 Visualize a specific physical code change
I start each session with a specific goal in mind that I want to accomplish. At the beginning of each 15 minutes I visualize making a specific code change. For example: implement this form such that when I click 'save' I see these records in the DB). During the 30 second 'rest', I ask myself "Am I on track?". This question has been useful because there are many times I stray off track by finding something interesting to think about or explore that is not exactly related to the task at hand :)
03 Timebox research tasks
In the event I need to look something up and I find myself in a search engine for more than a minute I set a timer to timebox my 'research'. Same goes with decision making. If I am trying to decide whether to use one tool vs. another, timebox that! These have historically been the biggest time sinks for me in the name of 'research' :)
04 Continue the flow through breaks or interruptions
I explicitly write down "todo next" in the code editor or a notebook when I am taking a break for lunch or when I am signing off for the work day.
I also try to leave my computer screen on the IDE with the next bit of code highlighted so when I open up my laptop the next day that's the first thing I see.
05 Reward yourself
Doing deep work and being focused on the task at hand is not easy. My current reward for finishing a 90 minutes session is getting to explore one or two things I've bookmarked during the session for deeper understanding (thread pulling I call it).
This flow works well for feature development. Slightly different flow is needed for debugging and designing/planning activities.
Hope this is helpful and inspires others looking to add some consistency to their programming habit.
What techniques do you use to optimize for flow during your programming sessions?
Top comments (0)