I have to be honest, I know a lot of people who claim that they can write really good code if they've been drinking.
I just absolutely do not understand how that is even possible. If I have ONE beer, it throws off my ability to write good code, or hold all of the concepts in my head. One of the weekly coworking meetups I go to always ends at a brewery (there is a brewery next door to the hackerspace where it is held), and while it is certainly a lot of fun being there brainstorming things, I don't understand how anybody gets actual code written after drinking.
Alcohol definitely blunts fast reflexes. If it also hinders coding, it's not for the same reason. If I had to guess, a little could fix anxiety and perfectionism, while a lot will leave you too incoherent to make something work at all.
> If I had to guess, a little could fix anxiety and perfectionism
This is exactly what happens to me, so I sometimes will code after a bottle of beer or a glass of whiskey. But it has to be little - more alcohol and I start losing focus.
This may be the case. I generally say I can't code worth a damn if I've had a beer or two, because my ability to really focus goes way down. But I've also had the experience of getting a bit buzzed and absolutely plowing through a whole bunch of easy-to-write code and enjoying it quite a bit, whereas it was otherwise kind of dull work.
For me, it can be a matter of actually doing it. I often suffer from analysis paralysis, so being a little tipsy means that I will actually write the thing. It'll be terrible, but it'll get done, and then sober me can go back and clean it up.
Or I'll go to far, write it, and it'll be unusable.
I used to do this sometimes in university. Haven't done it since entering the workforce, but they say sleep deprivation results in similar performance to being drunk. Not proud of it but I've found myself cornered into nightmare sleep deprived coding marathons by analysis paralysis / procrastination a number of times over the last few years. Alcohol might be preferable.
Back in university days I often wrote assignments while tipsy and then edited them when sober. Cider was just perfect for silencing the inner critic to get some thoughts to paper.
From what I understand, there's a substantial body of research indicating that a slight suppression of the prefrontal cortex can reduce the sorts of inhibitive filters that constrain creative thought. Too much, obviously, and you impair your cognitive ability. Too little, and self-doubt and over-analysis rules.
Anecdotally, I've noticed that I'm significantly more fluent in my third language when I've had a drink or two. I get many, many more compliments. When I'm totally sober, I tend to trip up more and overthink the grammar. There are lots of ways to reduce a hyperactive prefrontal cortex, including training (practicing art, meditating, etc.), but alcohol is by far the cheapest, quickest, and easiest.
There are certain types of code which I can unequivocally write better after a few drinks. It's honestly mostly low-complexity drudge work which needs to get done but when sober I can't power through it as fast due to (a) boredom and (b) overanalysis of simple tasks.
This certainly isn't all the code I write (far from it) and it's not for everyone, but it's definitely true for me. That's why I don't think saying alcohol and code can never mix is right, but I agree that it shouldn't be a daily occurrence or the central aspect of company culture. I don't think an optional, after-work happy hour on occasion is such a bad thing though.
I've found I'm markedly better at two specific types of programming activities while mildly drunk (the "mildly" part being quite crucial, for me this means two beers or a couple of slowly sipped glasses of whiskey). One is getting a large amount of boring mindless boilerplate out of the way quickly because the alcohol helps me not get too distracted from sheer boredom. The other is re-architecting high level design after getting stuck on a flawed approach - it seems easier to devise and consider more "out there" ideas without getting too bogged down in implementation details prematurely.
Obviously, that's just my personal experience and while I'm quite confident in my sample size, I wouldn't generalize it to anyone else. YMMV.
I can do exploratory coding when drinking, but I won't waste my time or an employers trying to write production code while drinking. As you note, it just doesn't work.
There is something called the Ballmer Peak, which has even been demonstrated in one study. Up to a point, the theory goes, creative work benefits from mild intoxication. Beyond that point, productivity goes out the window. For me, I believe that point is around two drinks. For you, it could be teaspoons. Either way, I wouldn't generally drink before the end of the work day.
Personally, I find coding is hardest when you're blocked or stumped. Sometimes it helps to turn off the inner critic and experiment with code in a way that might feel unproductive during normal work hours. How I approach a problem outside of work is my business as long as the solution is solid. This should go without saying, but everyone's physiology is different. While most people get drowsy from pseudoeffedrine, it makes me hyper. That's why even if one treatment works for most people, it might not work for you.
I'll add that alcohol starts as an upper. It gives you a buzz that makes you feel good and want to do stuff. That's obviously beneficial if you can focus it on a work-related task. Several people here corroborated that hypotheses by saying they do. I've done it, too, in many situations.
I just absolutely do not understand how that is even possible. If I have ONE beer, it throws off my ability to write good code, or hold all of the concepts in my head.
One of the weekly coworking meetups I go to always ends at a brewery (there is a brewery next door to the hackerspace where it is held), and while it is certainly a lot of fun being there brainstorming things, I don't understand how anybody gets actual code written after drinking.
i know a lot of people who say they drive better if they've been drinking too. Doesn't mean it's accurate.
This is exactly what happens to me, so I sometimes will code after a bottle of beer or a glass of whiskey. But it has to be little - more alcohol and I start losing focus.
Or I'll go to far, write it, and it'll be unusable.
Everyone has some skill they insist they are "better at" when drunk.
I do not in any way shape or form endorse doing the same thing with writing production code.
These are only weakly connected.
Anecdotally, I've noticed that I'm significantly more fluent in my third language when I've had a drink or two. I get many, many more compliments. When I'm totally sober, I tend to trip up more and overthink the grammar.
There are lots of ways to reduce a hyperactive prefrontal cortex, including training (practicing art, meditating, etc.), but alcohol is by far the cheapest, quickest, and easiest.
"What?! Are you crazy?!"
"Don't worry, I got this."
Goes on to write vanilla JS.
This certainly isn't all the code I write (far from it) and it's not for everyone, but it's definitely true for me. That's why I don't think saying alcohol and code can never mix is right, but I agree that it shouldn't be a daily occurrence or the central aspect of company culture. I don't think an optional, after-work happy hour on occasion is such a bad thing though.
Obviously, that's just my personal experience and while I'm quite confident in my sample size, I wouldn't generalize it to anyone else. YMMV.
Personally, I find coding is hardest when you're blocked or stumped. Sometimes it helps to turn off the inner critic and experiment with code in a way that might feel unproductive during normal work hours. How I approach a problem outside of work is my business as long as the solution is solid.
This should go without saying, but everyone's physiology is different. While most people get drowsy from pseudoeffedrine, it makes me hyper. That's why even if one treatment works for most people, it might not work for you.
Wait, we're citing XKCD comics now as if they are peer-reviewed scientific journals?
Continue this thread — 2 more replies