Fifteen minutes before the doors opened, the product wouldn't load.
I was two years out of college, standing in a convention center in Las Vegas, and the software I'd spent every waking hour of the previous month building was about to be shown to real customers for the first time. There was no internet in the hall, so I'd hosted everything locally across multiple laptops. I refreshed. Nothing. I adjusted a configuration setting. Still nothing. A co-worker stalled the first customers while I kept clicking.
Then the backend finally came up, and the product appeared on the giant TV in our booth. Over the next three days, people loved it. And I loved every minute I'd spent building it.
A few months later, I was writing code for the exact same product and I couldn't stand it. Same codebase. Same features. Same me. That contradiction is what this post is about, because understanding it is the key to finding flow state for software engineers on purpose instead of by accident.
When the Same Work Feels Different
The company I worked for at the time built 3D building components for AutoCAD's Revit software. My product replaced the painful process of digging through zip files full of hundreds of parts with a searchable library built right into the tool. It had the potential to flip the entire business model.
But I was the only engineer. Every decision was mine, with nobody to challenge my thinking or show me a better way. I could feel myself hitting a ceiling, so I made the hard call to leave and join a team where I could learn from more experienced engineers.
The CEO asked if I'd keep working on the product as a side project. It seemed like an obvious yes. I loved the product, and the extra money didn't hurt.
Within a couple of months, I dreaded it. Every promise I made to deliver new functionality felt like a weight. I knew the code better than anyone alive, and yet I could not get into a state of flow. The same challenges that once made hours disappear now felt like punching a clock.
Nothing about the work had changed. What changed was why I was doing it.
What a Psychologist Learned From Watching Painters
In the 1970s, a young researcher at the University of Chicago named Mihaly Csikszentmihalyi sat watching painters work at their easels, expecting to confirm what the field believed at the time: motivation comes from external rewards. Work, get paid, work harder. Bigger reward, more effort.
That's not what he saw.
The painters entered an almost trance-like state when the work was going well. They ignored hunger. They lost track of time. They worked for hours, oblivious to their surroundings. And then, the moment a painting was finished, they lost all interest in it. They set it aside and wanted to start the next one.
If painting was about producing a beautiful object for reward, why didn't they care about the finished product? Why was the process more compelling than the outcome?
Every software engineer knows this state intimately. You start debugging a tricky issue before lunch, and the next thing you know it's late afternoon. You're starving, you desperately need a break, and none of those signals registered because solving the problem was more compelling than your body's basic needs.
The Discovery of Flow
Csikszentmihalyi spent decades chasing that question. In his 1975 book Beyond Boredom and Anxiety, he studied chess players, rock climbers, dancers, and surgeons, and found the same state of deep engagement across wildly different activities. He developed the Experience Sampling Method, pinging participants eight times a day to record what they were doing and how they felt.
The results revealed a paradox that should stop every engineer in their tracks. People were most likely to experience flow at work, yet they said they preferred leisure. They were having their best experiences during challenging work and didn't recognize it.
Regardless of the activity, flow had the same ingredients: complete concentration, clear goals, and a balance between the challenge and the skill required. Enough difficulty to demand focus without tipping into anxiety. Self-consciousness disappears. Hours feel like minutes. The activity becomes rewarding in itself, independent of any external outcome.
Why Flow State for Software Engineers Is So Fragile
Here's what Csikszentmihalyi's research explained about my side project.
When you build something purely for the money, even a lot of money, you're working for an external reward. External rewards are real, but they're weak. They're not powerful enough to push you through the discomfort of hard problems. Flow, on the other hand, is strong enough to make you forget to eat.
That side project had all the same technical challenges it always had. What it lost was my emotional investment. My attention had moved to the new products I was building with the new team, and without that investment, the challenge stopped registering as a challenge worth caring about. The goals were clear and the skill balance was right, but the third ingredient, the feeling that the work itself was the reward, was gone.
This is why the hardest parts of engineering are so often the most enjoyable. Untangling a gnarly bug. Refactoring a mess into a clean architecture. Those tasks stretch you to your limits in the pursuit of something worthwhile, and that's precisely the condition Csikszentmihalyi identified as the best moments in people's lives. Not the relaxing ones. The stretched ones.
The Tolerance for Confusion
There's a second piece to this that goes back further than my first job.
I learned to code at ten years old, in a basement in central Illinois, from a step-by-step QuickBASIC book my dad found at a university bookstore. The first lessons were frustrating. I wanted to build something I cared about, not what the book told me to build. Without knowledge I couldn't problem-solve, and without the ability to problem-solve, I felt trapped.
This is where most people quit. Our brains are wired to avoid hard mental effort without payoff. When something demands significant work with no immediate reward, every instinct says stop. Find something easier.
Programming demands that you build a tolerance for confusion. You accept not knowing. You iterate through failure. You trust that understanding will emerge if you keep working. That tolerance is what separates people who become great engineers from people who try programming and walk away.
Someone told me years later that all software engineers are optimists. It sounded absurd until I thought about it. If you aren't an optimist, you give up long before this can become a career.
The reason this matters for flow is simple. Flow lives on the far side of confusion. If you bail out at the first sign of not knowing, you never reach the place where the challenge and your skill finally lock together and the hours start to vanish.
Finding Your Way Back: The Origin Story Exercise
Understanding flow is useful, but it doesn't solve the practical problem. Most professional software environments actively work against it through constant interruptions, unclear requirements, and unrealistic deadlines. You can't always control those. What you can control is whether you remember why you started.
I still have that QuickBASIC book. My daughter saw it recently and asked if she could use it to learn to code the way I did. When I opened it for the first time in decades, it was obvious the book had outlived its usefulness as a teaching tool.
She asked why I'd keep a book that wasn't useful anymore.
I told her about the basement. About sneaking downstairs after bedtime to an IBM 486 running Windows 3.1. About the eighth sheet of graph paper where I'd been mapping out block letters point by point, and the moment I realized I could use variable offsets inside a 10-by-10 grid to place any letter anywhere on the screen. What felt like thirty minutes was four or five hours. I had built something that worked, and I wanted to keep going.
That book is my token. When I look at it, I'm ten years old again, watching letters appear on the screen. There have been stretches in my career when the work felt like a grind, when deadlines and shifting requirements drove me to just get the project over with. In those moments, I had forgotten why I started. The book reminds me.
How to Write Your Origin Story
Your origin story is the first time you experienced flow while coding. Writing it down gives you something to return to when the work stops feeling like a passion and starts feeling like a job. A few questions to get you started:
What was the first problem you solved with code that made you want to solve another one?
Where were you? What do you remember seeing, hearing, and feeling?
What kept you going when you got stuck, before anyone was paying you to write code?
Don't worry about length or structure. Get it on paper. Then find a physical token that represents that moment, whether it's a book, an old notebook, or something that sat next to your keyboard, and keep it somewhere you'll see it. Any time writing code starts to feel like work instead of a craft, go back and read what you wrote.
It sounds sentimental. It isn't. It's a deliberate tool for restoring the one ingredient of flow that no environment can supply for you: caring about the problem.
Flow Is the Reward, Not the Bonus
I eventually stopped working on that side project. Not because the product was bad, and not because I'd lost the skill. I stopped because I'd learned something about myself that Csikszentmihalyi could have told me in advance. Money and status aren't strong enough to carry you through the hardest parts of engineering. Flow is. And flow only shows up when you're invested in the problem in front of you.
The rest of the question, how you systematically build the competence that makes flow state for software engineers accessible on demand, is what my book Don't Think When You Code is about. Your origin story is the entry point. Deliberate practice, task templates, and mental models are the system that lets you get back there again and again, even under pressure.
Start with the exercise above this week. Write your origin story, find your token, and put it where you'll see it. Then, when you're ready to build the practice system on top of it, Don't Think When You Code will show you how.
Joel Karr
CTO • Author • Engineering Leader
Joel leads engineering teams building AI-augmented software. Author of an upcoming book on deliberate software engineering in the AI era.
Enjoyed this? It's from the book.
These ideas come from "Don’t Think When You Code," coming in 2026. Join the launch list for a free sample chapter.
Launch news and a free sample chapter. No spam, unsubscribe anytime.
Comments
Related Posts
September 22, 2026
Experience vs Deliberate Practice: Why Years of Coding Don't Make You a Better Engineer
Experience vs deliberate practice: why years of shipping code leave engineers on a plateau, and the one-detail-a-day habit that turns daily work into training.
March 15, 2026
How to Get Better at Software Engineering: A Practical System for Faster Growth
A practical framework to become a better software engineer faster: deliberate practice, task templates, mental models, and flow state training you can use this week.
August 25, 2026
The Real Cost of Context Switching on Engineering Teams (And the One Habit That Fixes It)
Context switching on engineering teams kills productivity exponentially, not linearly. Here's the default-task habit that broke the cycle and saved a deadline.