Flow state and how it can improve developer productivity

As software engineers, we all aspire to become as productive as we can, so that we get the most done in the least amount of time. Productivity can be largely divided into two types: short-term and long-term. While there is so much conversation around long-term productivity, the likes of planning, scheduling, organization, task decomposition and time-blocking, there isn’t much information in regards to short-term productivity. As software engineers, short-term productivity is as important, if not more important than long-term productivity. Because if you think of it, the actual work — coding, designing or whatever that may be — gets done in blocks of a few hours every single day. This is when you need to have a clear mind and a natural rhythm, where your knowledge, motivations, and concentration all perfectly align. In the world of productivity systems, this is called the “flow-state”.

I will explain briefly what flow state is, how to get into a flow state every single day, and how it can massively accelerate your overall productivity as a software engineer.

What is flow state?

Many of you have probably experienced flow state at some point. It is a sense of fluidity where you are totally absorbed by and deeply focused on something, beyond the point of distraction. Time feels like it has slowed down. Your senses are heightened. You are completely immersed in the task-at-hand with seemingly effortless momentum. Some people refer to this as being “in the zone.”

Flow state was popularized by positive psychologists Mihaly “I don’t know his name” (Mihaly Csikszentmihalyi) and Jeanne Nakamura, which they describe as a very strong sense of focus that leads to a sense of ecstasy and clarity, where you know exactly what you want to do from one moment to the other. It is the highest level of short-term focus that very high-performing individuals like mountain climbers, chess players, surgeons, and ballet dancers have.

Flow state is equally important when programming, as we often maintain a lot of details in our mind at any given time. For example: What code path is the data flow taking? What values do variables hold, how are they changing as the code path progresses? Where are the breakpoints? How does the data structure, say a tree, visually look like at any given moment? Where exactly in the recursion stack are you? What does the overall design look like?

Sure, there are IDEs and tools to help you track that, but the most effective and productive software engineers can juggle this information in their short-term memory, creating a deep level of immersion, or flow-state, that makes them incredibly productive. But as amazing as this flow-state is, it is also all too easy to break out of with very simple distractions, which can completely kill the flow-state. I am sure you have all experienced times when you are in the middle of debugging something and you have 17 things juggling in your mind, you are about to figure the issue out, and someone comes and asks you a question. And then you have to start, all over again because you’ve lost the state you were in. Well, that’s what distractions do.

So what steps can we take to ensure that we get into and maintain a flow state?

There are 5 things you can do to ensure you set yourself up for success when it comes to being in a flow-state.

First, you need to eliminate external distractions

It’s been proven by research that in order to reach flow state, you must eliminate all external distractions. Every time you get pulled out of your focus, you’ll be taken further away from flow state. Only when you can focus with undivided attention for at least a quarter of an hour, you can get into flow state.

A Georgia Tech study showed that on average, a programmer gets only one uninterrupted 2-hour block of time per day, and that it takes a quarter of an hour to re-start coding after every interruption. In addition to that, a study in flow theory & self-regulation theory found that we face an average of 87 interruptions per day. And a study published on Gallup about office distractions found that people, on average, were only able to spend about 3 minutes on a given task before being interrupted in some form.

Second, you need to remove all internal distractions as well

Besides eliminating external distractions, you also need to eliminate internal distractions if you want to reach flow state. Whenever you experience stress or have too much on your mind, it’ll be incredibly hard to keep your mind focused on your task at hand — and therefore it’ll be impossible to reach flow state.

So, get rid of the distractions of chat, notifications, social media updates and whatever it is that gives you a quick dopamine hit. Even with apps that help you improve your productivity, like the calendar for example, there is a balance between using those tools to get your job done vs over-utilization, that can create too much noise. This balance is different for everyone, so you will need to find what works for you.

Third, make sure your task is decomposed and specific

I have already mentioned task decomposition in an earlier video where I talk mostly about long term developer productivity, so please check that out if you have not already. But the gist of it is that if a task isn’t 100% clear, decomposed and ready to code out, it isn’t specific enough for you to work on in a flow-state. When it’s not exactly clear what you’re supposed to work on, you’ll either switch between different tasks too quickly or get distracted much easily. Both will prevent you from getting into flow state.

To prevent myself from needlessly switching between various tasks, aside of having the task decomposed properly, I also make sure to track exactly where I spend every minute of my working day so that I can get a clear picture of how and where I spend my time. That way, I can improve my processes.

Fourth, find your biological peak time

If you want A-grade productivity, you will need to bring your A-game as well. So don’t attempt to get into a flow state when you are sleep deprived, lacking energy, or badly hungover. Getting into flow state is hard if you are low on energy. You need to have the willpower to focus on just one thing and not get distracted along the way. So make sure you are sharp and energized.

We all have our own biological clocks. Some of us are morning people, while the rest of us like to stay up late. Only you will know when you are of the highest energy. Pick this time to work on your coding tasks. Try to block your calendar for a couple hours or however much your job allows you to, to ensure that you work on your most critical tasks during this time without any distractions or interruptions.

Fifth, make sure your task is challenging enough

Take a look at this diagram. In order to reach flow state, you will need to be happy, confident, alert and focused. Having a well-defined task gives you the confidence in your ability to complete it. Working on an exciting feature keeps you happy. The right amount of challenge keeps you alert and getting rid of the distractions results in your being focused. And these are essentially the ingredients of getting into the flow-state. But as I mentioned before, work doesn’t come in a form that allows you to be happy, confident, alert and focused. It is often ambiguous, vague, too challenging and not motivating enough. It is up to you to break it down and do all the leg work to transform it into something that allows you to get into flow state. Consider being fit, for example. If your goal is to participate in a triathlon next year, that goal as a whole is too vague and challenging to work on. You will need to break it down to simple components. Then perhaps gamify each task by tracking your progress, competing with friends or giving yourself timely rewards so that each sub-task is exciting enough. After that, you will need to ensure you work on this on your biological peak time and do your best to remove internal and external distractions when you work on it. Only then will you give yourself the best opportunity to get into the flow-state, which in turn not only improves your odds at getting the task done, but also keeps your happy and fulfilled with what you are doing.

Well, hopefully this gave you a good idea about flow-state and the steps you can take to get into it. Let me know if the comments below if you have experience flow-state before. How often do you get interrupted and how do you make time to work on high-priority tasks?

Previous
Previous

Why you are not growing as a software engineer

Next
Next

Why are technical coding interviews so hard?