Why Do So Many Programmers Smoke? A Half-Scientific, Half-Experiential Theory
I have a theory about why smoking, vaping, heavy coffee drinking, and generally some kind of dependence on stimulants seem fairly common among programmers.
I’m not sure how much of this can be scientifically proven, but the more I think about it, the more it seems to match the everyday experience of coding.
Programming is a strange job.
You can spend hours looking for a bug. Everything looks correct. You check logs, read the code, build a hypothesis, reject it, and start over.
Then suddenly you find one tiny thing.
And you get that moment:
“Ahhh. Got it.”
Or maybe you’ve been thinking about the architecture of a feature for days and nothing feels quite right. Then the solution suddenly comes to you in the shower, in the car, or even in the middle of a meeting.
And in that moment, you genuinely feel victorious.
There’s a very specific feeling of:
“I solved it.”
Sometimes you don’t even need a bug. You find an elegant piece of code, discover a clean design, or come up with an abstraction that just feels right, and you get a surprising amount of satisfaction from it.
All of these things are rewarding to the brain.
Not in the overly simplified sense of “dopamine equals happiness,” but the brain’s reward system is strongly involved in discovery, prediction, surprise, motivation, and reaching an answer.
And programming is full of exactly those kinds of rewards.
What makes it even more interesting is that these rewards are unpredictable.
You might solve a bug in five minutes.
Or five hours.
A feature might work on the first try.
Or it might ruin three days of your life.
So your brain keeps going through something like this:
uncertainty → search → hope → failure → more searching → discovery → reward
And I wonder if, after spending years in this kind of environment, you slowly get used to these constant ups and downs.
Then there are the quiet days.
No interesting problem.
No clever bug.
No important architecture decision.
You just have to do the boring stuff.
Rename things.
Write migrations.
Build forms.
Do repetitive maintenance work.
And somehow, something feels missing.
My guess is that this is where some people unconsciously start looking for another source of stimulation.
Cigarettes.
Vaping.
Coffee.
Social media.
Or even that classic programmer habit where, as soon as the current project becomes calm, they somehow invent a new side project for themselves.
But with smoking, there’s another part of the story that I find even more interesting.
Get Reza Ahmadi’s stories in your inbox
Join Medium for free to get updates from this writer.
Imagine you’ve been stuck on a problem for three hours.
Your brain is done.
You get up and go outside for a cigarette.
For five minutes, you’re away from the screen.
You walk a little.
You stop staring at the code.
You don’t talk to anyone.
Your mind loosens up.
Then you come back to your desk and suddenly the solution appears.
What does your brain learn?
“I was stuck → I smoked → I found the solution.”
But a big part of that effect may have had nothing to do with nicotine.
Maybe you simply needed five minutes away from the problem.
There’s actually a concept in problem solving called incubation: you temporarily leave a problem alone, while your brain continues processing it in the background.
But our brains are not always great at carefully identifying cause and effect.
The cigarette happened.
Then the solution happened.
So maybe the cigarette helped.
Repeat that a hundred times, and smoking is no longer just smoking.
It becomes a reset button.
It becomes a break.
It becomes thinking time.
It becomes a reward after solving something difficult.
It becomes something that accompanies frustration, stress, and mental exhaustion.
And of course, nicotine itself really does affect the brain’s reward system and can create dependence.
So after a while, the whole story starts to reverse.
At first, you may smoke because you feel like it helps you focus.
Later, part of the “focus boost” may simply be the cigarette temporarily relieving the drop in concentration caused by nicotine withdrawal itself.
That’s when the loop becomes much stronger.
So I wouldn’t describe my theory as:
“Programmers run out of dopamine, so they start smoking.”
That’s way too simplistic.
I think it’s more like this:
Programming trains you to live with intense, unpredictable cognitive rewards.
The work itself also comes with stress, dead ends, uncertainty, and mental fatigue.
Smoking offers a fast and controllable reward.
And maybe even more importantly, it creates a very effective ritual for taking a break.
Which makes me wonder if what many programmers who smoke actually need isn’t the cigarette itself.
Maybe they just need to learn how to stand up every couple of hours, walk away from the monitor, look at something far away, and give their brain five minutes to do absolutely nothing.
Although, I have to admit:
“Let’s go outside for five minutes of incubation”
doesn’t sound nearly as cool among engineers as
“Let’s go have a smoke.”






