News for hackers. Stuff that matters.

Ask HN: Do you write more/better code when you are drinking/drunk?

I don't know about you guys, but my productivity goes through the roof when I'm drinking and coding. It lets me completely focus and ignore all of the random thoughts that are typically running through my head. I don't think "oh, I wonder how XYZ would work with ABC" and spend absurd amounts of time on random tangents.

I don't know if it was a state-dependent learning thing from my days as college student, or what.

Obviously, I don't drink at work, but you bet I do for my side projects.

Anyway, does anyone else find that it helps them?

( 8 comments | 8 points | on HN )
Re:Ask HN: Do you write more/better code when you are drinki... by nostrademons on Thursday December 11, 2008 @11:58PM (#395375)
More, yes, but probably not better.

We had a CS39 liquor cabinet in my Operating Systems Design course. Rum, vodka, gin, and lots of mixers. We needed it.

This led to some funny comments in the code, like

    // Don't believe anything this next line says
    // I'm drunk anyway.
Re:Ask HN: Do you write more/better code when you are drinki... by adatta02 on Friday December 12, 2008 @02:08AM (#395447)
I drink while I'm coding pretty routinely. I can't really tell if it makes me any more productive but it definitely holds up the programmer stereotype.

There is also that sense of urgency that you have to get stuff done before you get to drunk...

Re:Ask HN: Do you write more/better code when you are drinki... by dmoney on Thursday December 11, 2008 @11:18PM (#395337)
Apparently there's been some research into this topic: http://xkcd.com/323/
Re:Ask HN: Do you write more/better code when you are drinki... by icey on Friday December 12, 2008 @10:27AM (#395713)
I used to do this years ago - I'd get home from a night at the bar and decide to sling some code. Ultimately I had to stop doing it though; the code I wrote was written in such a different style than my ordinary style that it became problematic to troubleshoot easily.

That being said, there was more than one occasion where I solved a problem after drinking that I was having a problem figuring out prior to it.

Re:Ask HN: Do you write more/better code when you are drinki... by shutter on Thursday December 11, 2008 @11:39PM (#395360)
I've not tried this, but I would wonder how much the potential for "dumb errors" increases when in that state. I already say "Why the heck did I write that?" too many times even when sober!
Re:Ask HN: Do you write more/better code when you are drinki... by m0digital on Friday December 12, 2008 @01:17PM (#395894)
Ofcourse that's extremes to everything. If you develop while trashed I doubt its gonna turn out well.

However, I do find myself programming better with some beer. I actually feel a little more relaxed and focus better. Strange I know.

Re:Ask HN: Do you write more/better code when you are drinki... by lacker on Friday December 12, 2008 @12:23PM (#395842)
It doesn't seem to hurt for straightforward programs, but it's much easier to make bad design decisions while drunk. It also takes me forever to debug while drunk. I don't really think it helps me in any way.
Re:Ask HN: Do you write more/better code when you are drinki... by jmtame on Friday December 12, 2008 @02:05AM (#395445)
I'm glad you asked this, now I won't feel so bad about doing it.