Introduction
Programmers sometimes refer to the toilet as the ‘debug chair.’ At first, it might sound funny, but there’s some truth to it. Yes, it really is a debug room and a debug seat!
Sometimes, you may get stuck on bugs or problems, and even though they seem simple, you can’t figure out how to solve them. You might feel confused about how to tackle those obstacles. And then, out of nowhere, you’re forced to step away and visit the bathroom. In that moment, a solution magically pops into your mind, and you wonder, ‘How did that happen?’ Well, there are scientific facts behind this, which we’ll explore in this article.
Thinking Modes
I recently took a course on Coursera called ‘Learning How to Learn,’ which is an excellent course taught by two renowned professors: Barbara Oakley and Terry Sejnowski.

In the course, the professors explain that thinking is like a pinball game, where our thoughts bounce around from one idea to another.
In that course, I learned that we have two modes of thinking: focused mode and diffuse mode.
The Focused mode is what we’re familiar with: it’s when you concentrate intently on something you’re trying to learn or understand. On the other hand, Diffuse mode is a more relaxed thinking style related to a set of neural resting states. This thinking allows us to view problems from a broader perspective, often leading to new insights.
Let’s get back to our Pinball Game example. In the Focused mode, the bumpers are placed close together, guiding the ball along familiar neural pathways. These pathways allow for efficient thinking and problem-solving when working on tasks you already understand, such as basic arithmetic or familiar concepts in a well-known subject. The ball moves smoothly along well-paved roads, representing established neural patterns.
But what if the problem requires new ideas or approaches? This is where the Diffuse mode becomes essential. In this mode, the bumpers are spaced farther apart, allowing the ball to travel more freely and explore new areas. This broader perspective helps form new neural connections and pathways crucial for tackling unfamiliar or complex problems. While the Diffuse mode doesn’t allow for the precision needed to finalize solutions, it sets the stage for the Focused mode to refine and develop these new ideas.
Toilet How? Tell me, How do you do magic?

As you can see in the picture (picture 1), this is focus mode, where we concentrate on debugging a problem while sitting behind our desk, working on a laptop or PC. In this mode, our ideas are tightly connected, and sometimes, we can’t access the specific part of our brain we need to solve the problem.

While the answer is in the green dot.

And that’s why, when we stand up and go to the bathroom, our brain shifts from focus mode to diffuse mode (picture 3). At that moment, our mind becomes calmer, we relax a bit, and with a single thought, we can access the part of the brain we need and tackle the obstacle. Such things sometimes happen when you are sleeping.
Conclusion
Switching between focused and diffuse thinking modes is crucial for effective learning and problem-solving. While intense concentration helps us tackle familiar challenges, sometimes stepping back, relaxing, and letting your mind wander can spark new insights and solutions. Embrace the balance between these two modes to keep learning and growing.
I firmly suggest watching the Learn How to Learn course — it’s an incredible resource to deepen your understanding of these concepts and enhance your learning techniques.
And remember:
while (you_are_alive) {
if (bug) {
visitToilet();
} else {
code();
}
}GOF :]
Refrences

