The second English piece from "Psychology of the Keyboard," a series I write about the mental side of being a programmer — the part nobody puts in the documentation.
I was standing at the sink, mid-wudu — not in front of a laptop, no editor open, not a single line of code in front of me — and the solution just jumped into my head. I'd been stuck on a bug for two days: an integration issue between FastAPI and Oracle. I'd tried everything — changed the query, dug through the documentation, asked everyone I could think of. Nothing. Then, while washing my hands, with zero warning, I suddenly understood: the problem wasn't in the code at all. The connection pool wasn't closing properly before it reopened. Something embarrassingly simple — but my mind couldn't see it while I was sitting there forcing focus.
That's not a coincidence. In cognitive psychology it's called the Default Mode Network — the part of your brain that activates when you're not demanding conscious focus from it: washing dishes, walking, showering. In those moments, your brain isn't off. It keeps working quietly in the background, connecting pieces of information that were scattered while you were focused, which is exactly what produces that "sudden" solution.
The problem is that we're trained, as programmers, to believe the answer comes from pressure — the harder you focus, the faster you'll find it. That's true, up to a point. Past that point, it works in reverse. When your brain sits on the same problem for two hours straight, it drops into a narrow tunnel of focus that shuts out every other possibility, and just keeps circling the same idea that already failed.
Boredom isn't the enemy of creativity. Boredom is the door that opens that space — when you let yourself get distracted for a bit, without a phone, without a screen, not to be lazy, but to give your brain the chance to work in a completely different mode than the one you're used to at your desk.
Take this as a rule, not a luxury: when you're stuck in front of a problem and can't move a single step forward, step away. Not just to rest your body — to give the other half of your mind room to work.
Has a coding solution ever come to you while you were nowhere near a computer? Tell me where, and when.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)