Ask HN: How much of your production code have you written while drunk

8 points by savoy11 ↗ HN
This is pretty much straight-forward. I'm trying to co-relate being drunk and production code, so please be honest here - how much of what you have written and is still in production is while being under the influence?

12 comments

[ 3.1 ms ] story [ 160 ms ] thread
None. I don't drink, and if I'm impaired in any way (e.g., sleep deprived or brain-fogged by antihistamines) I don't write code.

Doing otherwise is just plain irresponsible.

Right, but I'd like to hear the reasoning behind that. You mate with women while being drunk, you do lots of other stuff - and most of it is good. So why not code?

Give me the explanation behind that.

You mate with women while being drunk...

I don't think that's a good idea, either. In both cases, if you make a small mistake you might need to support it for the next couple of decades.

Driving is good, why not drive while drunk? The fact that you pose the question in that way indicates you have not thought about this at all which makes me wonder if you are even old enough to drink.

BTW the answer as to why not code when drunk is that you are almost certain to do a bad job. Coding requires discipline and thought, attributes you usually seek to abandon when drunk.

Perhaps he works for Airbus?

edit: apologies, cperciva, hadn't read your profile. Backup software is nearly as critical!

While drunk, probably very little. I used to when I was a lot younger. In fact about 8 years ago I wrote the smallest /bin/sh execve shellcode for x86 I'd ever seen while completely out of my tree. I was amazed it worked.

These days I generally find that a beer is fine, two can give a temporary boost in productivity (as I find it easier to focus) but more than that and I have to stop.

Alcohol's probably the wrong substance to code on. Something like caffeine is probably better.

Just because I like to check HN whilst I'm at work doesn't mean I don't care about the quality of my output. I don't write code whilst drunk, in the same way I wouldn't expect a doctor to do his job whilst drunk.
The co-relations of driving, being a doctor, etc are really making me laugh hard. How much of what you have guys written is that important? FourSquare... look at me, I'm at McDonads and taking a pee

You guys are taking yourself why too seriously, for a (most probably) lousy job.

Production code? None. Random bits and pieces? Quite a lot.

Some of the bits and pieces I wrote while intoxicated did end up in production, but only after careful review, so... that doesn't really count, does it?

Interesting question.

Personally I find my work to be fairly similar to a writer's, in that my prime responsibility is to produce something interesting for an audience. Nobody will hold me liable for the means I've used to get there. So, like many authors, I'm not averse to having a few drinks while working late at night.

I've written code drunk (read: one beer, I'm a lightweight) a few times--mostly for personal projects, but at work occasionally. The results tend to vary: sometimes it's bloody inspired, other times I have no idea what I was thinking. It does seem to help with ``analysis paralysis''; where there are so many conditions and overlapping cases to consider that you can't even begin writing the code. Sometimes forging blindly ahead helps you think through the problem better.

But always check your commit logs the next day. :)