Flow zone(aka Zone) is that state of mind in which a programmer is highly focused on solving a particular problem. His brain is fully concentrated on solving the problem and he is disconnected from the rest of the world. When he gets out of the zone, he gets the feeling of getting things done. He also gets an immense feeling of being hyper-productive and wants to get into the flow zone more often.
Being concentrated to solve a problem is the most important thing that programmers should do. But what is wrong with it? According to Uncle Bob, the flow zone is a trap. It is a trap that can diminish the big picture of the problem you are trying to solve. Let me make that simple for you.
Do you remember the last hobby project you started and you stopped working on it after a few days, weeks, or months? Your hobby project was a cool idea to build a trading website but you spent hours choosing a good font for your website instead of writing an algorithm. You checked one font, the recommendation system suggested similar other, you kept on trying one and another. You entered the zone and got lost there. After an hour you realized no real work is done. Maybe at the end, you chose one descent font but the zone made you lost and you did not realize the actual problem you had to solve.
Another example of getting into the zone is that. You were asked to write a module of software and in the middle, you did not know how to handle one strange exception. You started surfing the internet and did not find anything, you started checking Github issues and didn’t find anything there either. You decided to create a new issue asking for help. You already entered into the zone and you didn’t even realize. You did not ask yourself if handling that exception was important for your use case.
Does that mean getting into the zone is no good at all? In fact, it depends, sometimes if you are in the zone for short period it can be good but for long period it is bad. It might give you a sense of being more productive but in most cases, the code written when you are in the zone will be needed to be re-evaluated and refactored later.
So how can we avoid the zone? To avoid it you must know you are in it. After reading this article, it will be easier for you to know you are getting into the flow zone. Try to avoid it after that.
You can read some tweets or surf Reddit or check my articles in dev.to once you start feeling you are getting into the zone. You can also try pair programming which does not let you enter the flow zone since two people communicating cannot get into the flow zone at the same time.
Let me know what you think about the flow zone.
The idea and reference of the above content are taken from Uncle Bob’s Clean Coder book.