Drugs in programming, as well as other occupations, play an emotional role as much, or more so, than a cognitive role.

If Habit A helps a programmer who'd otherwise be sidelined by emotional problems stay in the chair, it may help that programmer be more productive than they would be otherwise. Of course, addictions don't help us face those problems in the long term, and often let them get worse.

All sorts of drug-related behaviors exist among programmers. Many shops full of brogrammers celebrate beer o' clock at 4pm. Other programmers sneak out alone or with friends at lunchtime to a bar or convience store to enjoy some alcoholic drink.

Many programmers abstain from intoxicants at work, except for the common stimulant caffeine. Others are hooked on opiates after being perscribed them for chronic or acute pain.

LSD, even the weak stuff common in North America from 1970 to 2001, is profoundly distracting. Years ago I ate a pinch of mushroom dust and found that 25 minutes later, I couldn't keep my eyes straight to even look at a computer screen. On the other hand, it's the only sacrament that's clinically proven to more create spirtual experiences than a placebo -- the ability of hallucinogens to create profound changes is practically unlimited.

Long before the statute of limitations, I once received a gift of several dexedrine pills from a friend diagnosed with ADHD. I took one on the the first day of a new project and felt euphoric. I wrote several hundred lines of beautiful code that would serve the nucleus of a system that was planned to replace critical functions of a production system that tens of thousands of people depend on every day.

A week later I had a more sobering experience. I was tasked with upgrading another production system, and with the dexedrine tab in me I felt cocky and by 9:08 am I'd deleted the master instance of the production system.

I got forbearance from my co-workers because we had a backup ready, and a tested restore procedure, so we had the system back in 13 minutes and soon proceeded with the upgrade.

That was a portent of things to come. The project I was working on had no project manager and a group of stakeholders that hated each other. I tried to code my way of a difficult interpersonal problem and ultimately it all came apart. A year later I deployed the new system with hardly any testing and of course it didn't work. After a week of month of daily patches, each bug fix breaking something else and spreading database corruption, we threw in the towel and reverted to the old system.

My contract didn't get renewed at that employer the next year, and that was the beginning of my being a "journeyman" as a mercenary maintenance programmer.

Perhaps I shouldn't blame two amphetamine pills for something that was so much bigger; but I like the story that the pills started the project out in a state of spiritual misalignment. Had I listened to people instead of coding, things might have worked out differently. I might even have quit and had an easier time getting my next job.

Some programmers adocate nootropic drugs like Piracetam but I think those are just as bad as speed. They mess up your reward pathways and make you feel like you're Tony Stark but they don't really make you a genius.

I for one am addicted to caffeine and find it quite difficult to stop, even though it screws up my digestion almost to the point where I throw up. It's terrible, but at least I'm better off than the alcoholic and dope addicts I've met.