News for hackers. Stuff that matters.
Re:Ask HN: How much of your production code have you written... by cperciva on Thursday November 25, 2010 @09:51AM (#1940320)
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.

Re:Ask HN: How much of your production code have you written... by savoy11 on Thursday November 25, 2010 @10:00AM (#1940336)
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.

Re:Ask HN: How much of your production code have you written... by cperciva on Thursday November 25, 2010 @10:35AM (#1940412)
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.

Re:Ask HN: How much of your production code have you written... by epo on Thursday November 25, 2010 @12:13PM (#1940601)
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.

Re:Ask HN: How much of your production code have you written... by dtf on Thursday November 25, 2010 @06:16PM (#1941220)
Perhaps he works for Airbus?

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

Re:Ask HN: How much of your production code have you written... by aphyr on Thursday November 25, 2010 @12:30PM (#1940635)
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. :)

Re:Ask HN: How much of your production code have you written... by _b8r0 on Thursday November 25, 2010 @10:11AM (#1940363)
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.

Re:Ask HN: How much of your production code have you written... by pavlov on Thursday November 25, 2010 @10:48AM (#1940438)
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.

Re:Ask HN: How much of your production code have you written... by Jabbles on Thursday November 25, 2010 @10:11AM (#1940365)
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.
Re:Ask HN: How much of your production code have you written... by savoy11 on Saturday November 27, 2010 @07:06AM (#1944826)
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.

Re:Ask HN: How much of your production code have you written... by madhouse on Thursday November 25, 2010 @10:43AM (#1940430)
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?

Re:Ask HN: How much of your production code have you written... by ehutch79 on Thursday November 25, 2010 @12:49PM (#1940681)
all of windows was? see: http://xkcd.com/323/