Mindful coding

Mindful coding

How to overcome zombie mode when coding and debugging

In the first few months of coding, I noticed a bad coding habit starting to emerge. I call it zombie mode.

Usually it starts when I hit an error, and I jump right into troubleshooting it. I google for the error message, and browse through the results and start to fall into a rabbit hole of the internet. After the third or fourth results, my eyes start to glaze over. My brain start to turn to mush, exhibiting signs of information overload. Classic cognitive overwhelm.

And I just sit there flipping through web page after web page, really determined to solve the problem, yet not really thinking clearly to hunt down the right answer, but just kind of mindlessly consuming and being bounced around different answers while in this “zombie mode”. It’s not the best for productivity, and it’s mentally draining.

The funny thing is, sometimes I get up to go to the bathroom or have a water break by happenstance, and usually that’s when some small breakthrough will bubble up in my head. Or it might happen when I’m rubberducking – writing down the issue to ask for help on a forum or from friends. The point is, whatever that gets me out of mindlessness back into a state of being alert and mindful, is usually the breakthrough. And that’s great because now I get to apply some of the mindfulness practice techniques I use in daily life, to coding.

That got me brainstorming a bit... What can I do to be more mindful while coding? Some ideas that came up:

🚰 The longer my coding session runs, the harder I should be practising mindfulness. Because any bug that takes more than 30min will start to tire me out, so I should start taking attention breaks to think clearly rather than continuing to burrow down head-first. I should be approaching it like short intense sprints of hard, clear thinking, rather than a marathon of low to moderate mental effort. So water breaks, bathroom breaks on timer when coding.

⏲ Use a timer to introduce hard attention breaks into the screen. I use a Mac menu bar app called Tadama, that blanks out the screen with a 30s countdown timers every 30min. For a while now I kept turning it off as it felt distracting (especially when writing), but maybe when I start any coding I should toggle it back on to help me break out of zombie mode should I fall into it unknowingly.

📝 Sketch it down, write it on paper or type out the issue as I would when asking someone else for help. That brings my mind back to a state of meta-cognition and observer mode, so that I can think clearer.

📋 List out the questions I have about the error and the results that come up, and be methodical in searching for each one by going down the list (instead of randomly bouncing around web pages).

Any other suggestions for mindful coding?

Follow my daily writings on Lifelog, where I write about learning to code, goals, productivity, indie hacking and tech for good.

Share this