Ask HN: Drunk programming?
Who can do it? Any tips? Back at University I could all the damn time. Now that I'm writing "production code" (lol) I can't for whatever reason...I think I just can't concentrate enough, perhaps? Not really sure what's blocking it.
So, can/do you? Any hints or tips?
Note: Posted while drunk.
Booze, nope - checking my code in the morning makes me want to cry because it's so bad.
Weed, yep - checking my code in the morning makes me want to weep with joy, because there's so much of it and it's so cleverly done compared to my usual fare. The only problem with it is that I never comment or use descriptive variable names... so it can be a bit tricky to get my head around at first. It's basically done by a much better programmer than me, but one who doesn't realise the importance of clarity of intent.
I drink socially. When I'm drinking I want to be hanging out with friends, not coding. Personally, I fall asleep if I get drunk and sit down at the computer.
I think the key to programming drunk is keeping it to one or two beers. Sometimes when programming sober I become distracted thinking too much about ideas for other features or even other projects. A beer or two can help ease your anxiety and help focus. Also the amount of work left to be done to complete an application can sometimes feel overwhelming and kill my motivation to continue. Sometimes a couple beers can help with the hardest step which is just start. So next time your dreading starting a new feature just pop a cold one, relax and watch the code flow.
Mhmm.. well I can tell that at work we like to take a few beers on Friday afternoon and it has become a running gag that Friday afternoon code always has to be double-checked on Monday morning.. For what I can say, we tend to be really less focused when we're having a beer and we get distracted by talking to co-workers. In the end, we're not coding as much as we could have done if we were sober and our code is crappier.
I have to agree with the majority point here. A stiff cocktail or just some hard alcohol on ice and I can program (very slowly) pretty well. One beer and I want to curl up under my desk and go to sleep. As a possible counter-point I knew an ex-M$ employee that could drink 6 beers during lunch then go back to work and be productive. :) I have much to learn before I shall become a jedi-knight.
Some of my finest code used to be written whilst drunk. I wrote scanners, exploits, all kinds of stuff at company kick-offs and in hotel rooms after nights out.
When you write code for other people to use though, it's best not to get drunk. I think drunk coding is great for hacking, not so good for production code. I'm with hcarmichel, keep it to one or two beers tops.
I have no problem doing casual programming tasks while drunk.
Also, I can code as hell all night long drinking whiskey+coke, while with beer my motivation vaporizes the moment I open the can.
About student life vs real life, now you're simply tired of working so you're less motivated to do code when you drink at home to relax. That's just it, I have the same experience.
Buzzed to drunk off wine or liquor actually helps me focus, especially after a long day. Turn on the classical music too and I'm golden for a few hours.
Past drunk (eg wasted), I can't do it, and beer usually just saps my motivation completely.
Alcohol is a central nervous system depressant, so it slows higher brain function. It doesn't seem like a good match for programming, which is the essence of higher brain function.
Best advice regarding this topic:
Write drunk, revise sober. -Pragmatic Guide to Thinking and Learning
I can write code drunk, but I never would for work. When you need to get it right the first time, or work without a spec, or work on production code that's mission critical, you're going to start thinking of all the things that can go wrong (and second-guessing yourself a whole bunch). Try writing drunk for your personal projects where creativity is required, and try and keep the booze out of the (home?) office- can't imagine what good would come of it.