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.
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.
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?
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.
These are only weakly connected.
"What?! Are you crazy?!"
"Don't worry, I got this."
Goes on to write vanilla JS.
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.
I do not in any way shape or form endorse doing the same thing with writing production code.
Also, if you think people can't get actual, working code written when shitfaced, then I guess you haven't met the demoscene crowd ;).
There are times when a problem is intractable and I get frustrated through thinking too much about an issue. Alcohol, like caffeine, has its place. I want to stress that I'm not talking about getting hammered at the office, or even mildly drunk, I'm talking about the fact that for some people, a single beer after many hours of work can be helpful in calming them down enough to focus on the whole problem again.
Alcohol can certainly have performance-enhancing effects: comically, the first Olympic disqualification for doping wasn't for steroid use or anything similar - it was for a man drinking "two beers" before his shooting match to calm himself down enough to operate at peak levels.
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.