How programmers can use the focussed and diffuse modes of the brain

adminguy's picture
Posted September 15th, 2015 by adminguy

     

 

Image Credit

Thomas Edison, the famous scientist, had an interesting quirk in the way he worked. He would often break away from work, sit in a chair, and relax with a few ball bearings in his hand. Relaxing in his chair opened his mind, and the ball bearings - which dropped noisily on the floor every time he dozed off - kept him from sleeping. These breaks often lead to deep insights, aha moments, or magical solutions to pressing problems. Apparently Salvador Dali the famous, eccentric artist also had a similar routine. In Dali's case it lead to leaps of unbounded creativity.
 
According to Dr. Barbara Oakley, a professor of engineering at Oakland University, these men were engaging what she calls the diffuse thinking mode of the brain.
 
Since the very beginning of the 21st century, neuroscientists have been making profound advances in understanding the two different types of networks that the brain switches between—highly attentive states and more relaxed default mode networks.[i] We’ll call the thinking processes related to these networks the focused mode and diffuse mode, respectively—these modes are highly important for learning.[ii] It seems you frequently switch back and forth between these two modes in your day-to-day activities. You’re in either one mode or the other—not consciously in both at the same time. The diffuse mode does seem to be able to work quietly in the background on something you are not actively focusing on.[iii]  Sometimes you may also flicker for a rapid moment to diffuse mode thinking. -- Barbara Oakley via Science Friday
 
The focused mode is like a sharp spotlight. It involves the prefrontal cortex of the brain and focusses attention on one specific thing leaving out everything else that is not essential. This is the mind of the expert archer who never misses bulls-eye. The mind is razor sharp and focussed. It is essential for analytical thinking, scientific problem solving, critical thinking, etc. As software developers, we should try and be in focused mode to write robust, error-free code.
 
However, just like Edison, we too can and should benefit from the diffuse mode network. Writing code is just one part of software development. As developers we also need to understand the big picture. How well will our code interact with the rest of the system? Have we covered all possible boundary cases in the unit tests? What are the implications of a certain design decision? Such questions cannot be answered in the focussed mode. Our mind's vision is too narrow and it's easy to miss the forest for the trees. Seeing the big picture requires a switch over to the diffuse mode. In this mode our mind is more like a very bright street light. It illuminates everything in its periphery. It's the mind of Zen - illumination without discrimination. It helps us see the big picture. It is also in this mode that the brain makes connections among disparate things which we may have gathered while in the focussed mode. These disparate connections give rise to aha moments and what often seems like magical solutions to difficult problems. Furthermore, our brain also consolidates information in the diffuse mode. If you, like many other developers, find it difficult to remember what you wrote three months back - entering the diffuse mode often, may just solve that problem.
 
I have seen many brilliant software developers work in an alternating pattern of focussed and diffuse mode thinking. They code feverishly in the focussed mode for 40 minutes to an hour with high levels of concentration. After that they step back and take a stroll, or go to the water cooler, or just look out the window. But they don't talk to anyone! Stepping back switches their brains to the diffuse mode where they can process what they just did and understand the big picture implications. Here's where it dawns on them if the Singleton design pattern they just coded will be an asset or a liability for the overall design. Here's where they also get aha moments and suddenly understand why that painful query is taking 100ms instead of 50. Emails, instant messages and friendly banter is all made to wait till the time they are out of the diffuse mode.
 
Most of these developers don't actually know about these two modes. They just intuitively know how to work with their minds. But unfortunately, nowadays, perhaps because of social media, we don't take advantage of either of these modes. We just work in a state of continuous partial attention, which is probably the worst state to be working in. It neither gives the opportunity to focus and write good code, nor does it give a chance to step back and see the big picture. Instead of alternating between focussed and diffused mode, we have started alternating between StackOverflow searches and copy-paste coding. Understanding how the mind works and how we can take advantage of it's natural states is very important for developers who want to improve their skills and progress in their careers as programmers. 
 
Try this out when you get back to work. Make a plan for what you need to do next, and set a timer for 40 minutes. Spend that time in an intensely focussed state without any avoidable interruptions. That means no email, instant messengers, or mobile phone interruptions. It also means not paying any attention to why the person in the next cubicle is guffawing like crazy, or that cool gadget, folks in the next aisle are discussing. Absolutely nothing but the work in front of you. Once 40 minutes are up, take a step back. Get up, take a stroll, look out the window... whatever works. But don't chat with co-workers yet. This is the biggest mistake. Chatting will take the mind out off the diffuse mode. Spend 10 - 15 minutes (or whatever time you need to) in the diffuses mode, once again without any interruptions. Now it's time to  pat yourself on the back and spend some time answering emails and checking out that XKCD cartoon that made your neighbour guffaw a few minutes back. But not for too long. It's time to get back to the next round of focussed work.
 
Try working this way for a week and you'll see an enormous rise in the productivity and quality of your work. You will also be able to leave work on time, spend time with your near and dear ones, or spend more time riding that new mountain bike you just bought, not to mention the warm fuzzy feeling of a day well spent.