There is a specific kind of tired that only programmers know. It is not the tired you feel after a long run or a late night out. It is the tired that comes after spending four hours hunting a bug, finding it, fixing it, and then discovering that the fix introduced two new bugs. Your eyes are dry. Your coffee is cold. You have read the same stack trace so many times that the words have lost meaning. You are not sleepy - you are cooked.
That was me a few months ago, deep in a React hydration error that made absolutely no sense. The component worked fine in development. Staging was a disaster. I had tried everything I could think of. I was getting to the point where I was making random changes just to see what would happen, which is never a good sign.
I shut down pc, opened Lichess, and played three games of chess.
When I came back forty minutes later, I spotted the issue in about ten minutes. It had been right there the whole time.
The Brain is Not a Computer
We treat our brains like they should be able to run indefinitely without rest - just keep feeding the problem in and expect a solution to come out. But that is not how it works.
Cognitive fatigue is real. When you are deeply focused on a problem for hours, you are heavily using your prefrontal cortex - the part responsible for logical reasoning, problem-solving, and decision-making. At some point, it gets depleted. You start making more mistakes. You miss obvious things. You get tunnel vision and can only see the problem the way you have already been looking at it.
This is not weakness. It is just biology.
The frustrating part is that most of us have been taught to grind through it. Just focus harder. Just try one more thing. Work longer. But in my experience, especially working on client projects here in Nairobi where deadlines are tight and the client is calling every other day, grinding through cognitive fatigue almost always makes things worse. You end up spending two more hours being unproductive, and then you get back to your desk the next morning fresh and solve it in twenty minutes.
The time away was never wasted. The grinding was.
Why I Landed on Chess Specifically
I have tried other things. Taking a walk works. Making tea and just sitting helps sometimes. Watching YouTube is a trap - you end up down a rabbit hole and come back more distracted than rested. Social media is even worse.
Chess works for me because of a specific property: it completely occupies my mind, but in a different way than code does.
When I am debugging, my brain is in a very narrow, analytical mode. I am tracing execution paths, reading error messages, checking state values. It is all very linear and detail-focused. Chess takes me into a different kind of thinking - spatial, strategic, forward-looking. I am thinking about patterns on the board, anticipating moves, considering multiple possible futures at once. It is still mentally engaging, but it is engaging a different part of the brain.
This is not my personal theory. There is research around the concept of mental rest that suggests certain activities promote recovery better than others. Completely passive rest (like staring at the ceiling) works. But so does switching to a different kind of mental engagement - one that is not demanding in the same way as the previous task. Chess happens to sit right in that zone for me.
Also, a ten-minute game on Lichess is free, requires no equipment, and I can do it from my phone. Low friction matters when you are already exhausted.
What Burnout Actually Looks Like
There is a difference between the acute brain fatigue I described above - the kind you get from a rough debugging session - and actual burnout. I have experienced both.
Burnout is the slow version. It builds up over weeks or months. You start dreading opening your laptop. Tasks that used to take you an hour take three. You feel detached from the work, like you are going through the motions. Small problems feel massive. You stop caring whether the code is clean or just functional.
I hit a mild version of this, during a period where I was juggling three projects simultaneously and barely taking rests. The chess breaks helped, but they were not enough on their own. What actually pulled me out of it was genuinely stepping away from code for a few days, getting outside more, and cutting down to two concurrent projects.
The daily mental breaks are maintenance. The bigger breaks are repairs. You need both.
The Hard Lesson I Learned About Pushing Through
The worst debugging sessions I have ever had share a common pattern: I knew I was too tired to think clearly, but I told myself I was close and just kept going.
Every single time, I either:
- Made a change that seemed logical but was actually wrong, which cost me more time to undo later
- Missed something obvious that I saw immediately the next morning
- Got so frustrated that I started making careless mistakes in parts of the codebase I was not even supposed to be touching
There is a moment - you will know it when you feel it - where your brain sends you a signal that it is done. Your eyes are not focusing properly. You are re-reading the same line four times. You have started talking to yourself out loud and not in a helpful way. That is the moment to stop. Not in ten more minutes. Right then.
I have had to learn to respect that signal instead of ignoring it.
Building a Rhythm That Actually Works
What I do now is not complicated, but it took a while to arrive at it.
During long coding sessions, I take a proper break roughly every ninety minutes. Not just standing up to get water - an actual mental break where I do something completely different for at least fifteen minutes. Some days that is chess. Some days it is a short walk around the neighborhood. Occasionally it is just sitting outside for a bit.
When I hit a bug that I cannot crack after about an hour of genuine effort, I walk away. I write down exactly where I am and what I have already tried (this is important - you do not want to lose context), and then I do something else entirely. Sometimes I come back after twenty minutes with fresh eyes. Sometimes I sleep on it and look at it the next morning.
I also stopped wearing "I worked until midnight" as a badge of honor. That is not dedication. That is just poor resource management.
One Thing Worth Trying
If you have never used chess as a mental break, Lichess is the obvious place to start. It is completely free, open source, has no ads, and you can play a five or ten minute game without creating an account. There is no algorithm trying to keep you hooked the way some other platforms are built. You play your games and you close the tab.
The point is not to become a great chess player. The point is to give your brain something genuinely different to do for a few minutes so it can reset. Chess happens to be that thing for me. For you it might be something else entirely - a short run, cooking, sketching, whatever.
What matters is that you stop treating rest as laziness. The best code I have shipped has almost always come after I gave myself permission to stop and come back. The worst bugs I have ever introduced were written after 10pm when I was running on fumes and stubbornness.
Your brain is your main tool. Treat it like one.