4 Practical Tips for Improving Your Programming Focus

Written on June 6, 2019

You choose the best focus playlist on Spotify, use the best tools money can buy, turn on “Do Not Disturb” on all your devices. But still, at the end of the day, you’re really tired but you’ve done nothing. And that happens day after day.

I faced focus issues for a long time, but I used some tricks to boost my attention while programming. Without further ado, let’s focus on the tips:

1. Prepare your day

That might sound cliché, but you have to plan on what you will work on your day. Either you prefer an online to-do list or paper and pen, have a list of things that you will do on your day. For example:

* Write tests for the Users API
* Investigate on yesterday's lag spikes
* Start working on the Google Analytics feature

It doesn’t have to be very detailed, but enough for you to recall what you have to do.

2. Break down your tasks and focus

Now you have a list of to-dos. Let’s suppose you will start to work on “Write tests for the Users API”. My tip is to break down that task in subtasks. For example:

* Write tests for the Users API
    * Test unauthorized requests are blocked
    * Test admin users are filtered

Once the task is broken down, you will start what I call a “focus session”. It’s a timeboxed moment where you will focus ONLY on that subtask.

The main problem with focus is that we’re trying to fill many holes at the same time. I had to learn to focus on a very specific thing and get it done. That is the best tip I can give: do one thing at a time.

3. Improve your focus session

For me, the Pomodoro Technique works the best. While focusing on my very specific subtask, I use this technique for time management. In case you never heard of, it consists of a 25-minute deep work session, then a 5-minute break, and back to another 25-minute deep work session. After 4 working sessions, you get a longer break.

This changed my work life. That helped me focus on specific tasks, even the boring ones.

4. Cut that distraction!

No tip will matter if you still have a lot of distractions during your day. Only you know what distracts you, and you have to cut the interruptions if you want to be a focused developer.

For me, browsing Instagram, Reddit, GitHub or StackOverflow really destroyed my productivity. By using the Pomodoro Technique, I’d only access those websites while on my 5-minute break. What worked for me was:

  • Turning on “Do Not Disturb” on my devices while focusing
  • Making sure your co-workers wouldn’t interrupt me by working somewhere else or wearing my headphones
  • Listening to instrumental music, or songs that I didn’t know (so I wouldn’t get distracted by it)

Do what works best for you!


It does not have how much time you work, but how much you deliver. Working for long hours without focus will only give you tiredness, and not work done.

Even though attribution is not required, I’d like to thank those amazing photographers that freely distributed their photos for this post on Unsplash. Thanks Charles Deluvio and Andrea Riezzo.