
Code sober, get things done drunk - AlexMuir
http://www.alexmuir.com/2011/11/code-sober-get-things-done-drunk/
======
calloc
I have personally programmed a lot while tipsy (never drunk, I am not sure I
would want to read that code in the morning) and it allows me to get over the
humps of writing that utility function that needed to be written but I was
putting off, it allows me to just start putting code down in vim without
really worrying whether or not it is good enough...

Let me quantify good enough a little better. I am a perfectionist, I tend to
write my code methodically and slowly and over-think and overanalyse every
last line, I refuse to write a piece of code if I don't think it is good
enough.

When I drink alcohol it takes away all of the above and lets me just write the
damn code. Most of the time (there have been times that I've been closer to
drunk than sober) the code works exactly as required and it passes code
reviews without issues. It compiles, it works, and is the "perfect" code for
the situation. Sure three months down the line it may need to be re-factored a
little bit to add a new feature that was decided on by management, but in the
mean time it has shipped.

Now, please don't take my example and think that you can become a better
programmer by simply going out and buying a bottle of vodka. It most likely
won't work. Should you give it a try? Sure, what have you got to lose? Just
don't become dependant on alcohol as a way to function in everyday life. Been
there done that, and it is not pleasant at all.

~~~
droithomme
My experience has been really similar to yours. I also was plagued by
perfectionism, reworking things endlessly when I was younger. A beer makes it
go away, commit to a design decision that is not necessarily ideal because it
probably doesn't have to be ideal, and move forward.

I find it helps me focus as it stops my mind from wandering off down infinite
stacks over minor issues. Like caffeine though there's a certain precise
narrow level where this happens and if you go over that level it doesn't work.

------
mmaunder
My first thought is that you're opening yourself up to litigation. I drink
wine and occasionally code with a glass of wine - the easy stuff, and I only
commit the next morning. However, making strategic decisions, dealing with
human issues and sending external communications is a bad idea.

Someone I'm close is a former CEO and majority shareholder of business that
generated 8 figure yearly revenue. His advice to me was to "never hit the send
button until the next morning". I'm inclined to give you the same advice.

Alcohol lowers your inhibitions and your sensitivity to the needs and feelings
of others. It's a wonderful social lubricant but it also leaves you
occasionally cringing the next morning as you remember what you said. Usually
there's no record of it other than fading memory. Emails are on the record, so
you may be cringing for a long time if you get it wrong and it could be
expensive.

~~~
kevinalexbrown
You wouldn't sign an email with "Also, I'm drunk right now" but that's
effectively what you've done here.

Kudos for honesty, but you've now put a time stamp that says, roughly, "I
acknowledge being under the influence on Nov 27 2011, and further, this
allowed me to behave differently than I normally would." Anyone you've
interacted with today can go back to it. It's not just that you might be
making bad decisions - you are publicly acknowledging that those decisions
were made while drunk.

~~~
frobozz
I think that the advice "Don't hit send until the next morning" is sound not
only for post-booze emailing, but for anything done late in the day. Driving
whilst overly tired (for example) is known to pose similar risks to driving
under the influence of alcohol.

Although mmaunder has only mentioned holding off on emails due to drink, there
are many other reasons why one might author an email one evening, but not send
it in the morning (e.g. the need to check a fact with someone who has already
gone to bed or is otherwise unavailable). That mmaunder was drunk is not an
conclusion that can inevitably and reliably be drawn from such a timestamp.

------
udp
I'm the other way round - I try not to send emails etc when I'm drinking,
because I think my social behaviour changes a lot more than my programming
ability does (it's easier to write a message, but much more difficult to judge
if it's the right thing to say).

I find that after a beer or two I'm much more likely to stay motivated to work
on the same project, rather than procrastinating or switching to something
else. Keep in mind that the line between there and being _drunk_ can be
surprisingly thin.

(Homebrewing and working from home are a great combination to find yourself
drinking when you shouldn't be)

------
Duff
Sounds to me like a recipe for a bad habit.

If you have a problem doing "awkward" things like firing people, paying bills,
etc, you need to figure out the root of your anxiety and deal with it.

If numbing yourself with alcohol is how you get through, you may find yourself
turning to the bottle more. Alcohol isn't tea or coffee, and boorish behavior
isn't a measure of whether alcohol is affecting your life.

~~~
burgerbrain
Why does _"having difficulties firing people"_ have to have a "root cause"
other than _"you think of yourself as a fairly decent guy and understand the
effects getting fired has on somebody"_?

This is just pop psychology mumbo jumbo.

~~~
Duff
Having difficulty firing someone is normal -- I'm not suggesting that it
should be fun. Drinking Gin to give yourself the nerve to fire someone
probably isn't fine.

If you have a job to do, you need to be able to do it. If the psychic toll of
doing your job requires that you hit the bottle, you probably don't belong in
that job.

~~~
burgerbrain
There is a keen difference between not being able to fire somebody while
sober, and preferring to not do so. Similarly I _can_ not drink at parties,
but I can do so as well, so I do.

You are mistaking responsible drinking for dependancy.

------
middus
Yeah, sounds like a really great idea to handle business communication while
being intoxicated...

If you write 20 lines of BS code, it does not really matter. Thanks to your
VCS you revert and finito. On the hand, one wrong email can haunt you, because
it affects people. There is no undo.

~~~
tptacek
Do you drink regularly? I don't know anyone who gets 2-3 drinks in them and
becomes an entirely different person.

~~~
bryanlarsen
I'm having trouble understanding your comments. The article doesn't talk about
"entirely different people", we're talking about drunk people. No matter how
drunk you are, you don't become an "entirely different person", but you lose
the social inhibitions that prevent you from writing the types of emails that
offend customers.

And I'm not sure where 2-3 drinks comes from, either. 2-3 drinks get some
people drunk, but not large people or regular drinkers. That's not really
relevant, because even large people or regular drinkers start to lose those
social inhibitions after 3 quick drinks even if they aren't yet 'drunk'.

~~~
tptacek
I think the subtext of my comment was pretty straightforward: after 2-3
drinks, you're not going to send radically different emails to customers;
you're certainly not likely to torch relationships.

If anything, over the last several years, what I've found is that _stress_ is
far more likely to hurt relationships than intoxication. After a frustrating
day, I'm way more likely to be clipped, snippy, abrupt, or unhelpful. _That's_
the stuff that clients and customers remember.

I drink pretty regularly and can't think of a single time that intoxication
has harmed a business relationship (indeed, I routinely take clients out for
beers, like most other businesspeople do --- if alcohol and "loss of
inhibition" was such a force for chaos, one assumes this would be less of a
time-honored tradition).

On the other hand, I can think of many times where stress has damaged
relationships, sometimes permanently.

I picked 2-3 drinks out of a hat. I know the guy who wrote this post drank 4
glasses of gin before getting on a plane (I'd throw up if I did that; alcohol
and air travel don't mix with me), but 2-3 seems like a pretty reasonable
casual evening of answering emails.

~~~
bryanlarsen
OK then, I'll just disagree with you.

People are surprisingly easy to offend over email. I know that I've offended
some when sober. Sometimes it's because I'm too terse. Sometimes it's because
they're reading something between the lines that I didn't mean to say.
Sometimes I phrased things poorly. Sometimes I wrote it the email in anger.

Add 2-3 drinks in the mix and I'd probably double the number of offended
customers.

Taking customers out for drinks is a completely different situation. It's a
lot harder to be misunderstood in face-to-face conversations, not to mention
that the customer is drinking along with you.

~~~
timsally
_People are surprisingly easy to offend over email. I know that I've offended
some when sober. Sometimes it's because I'm too terse. Sometimes it's because
they're reading something between the lines that I didn't mean to say.
Sometimes I phrased things poorly. Sometimes I wrote it the email in anger._

It sounds like beer is accentuating (not causing) a problem with email
etiquette. Your point and Thomas's point are orthogonal: (1) two beers can
make you terrible at things you are already bad at and (2) two beers wont make
you terrible at things you aren't bad at. Because the bottom line is that
people aren't easy to offend over email. I've written 1 email that has
offended someone in the last 5 years and that was mostly intentional.

------
tree_of_item
"We Brits believe that alcohol has magical powers – that it causes us to shed
our inhibitions and become aggressive, promiscuous, disorderly and even
violent.

But we are wrong. In high doses, alcohol impairs our reaction times, muscle
control, co-ordination, short-term memory, perceptual field, cognitive
abilities and ability to speak clearly. But it does not cause us selectively
to break specific social rules. It does not cause us to say, “Oi, what you
lookin’ at?” and start punching each other. Nor does it cause us to say, “Hey
babe, fancy a shag?” and start groping each other.

The effects of alcohol on behaviour are determined by cultural rules and
norms, not by the chemical actions of ethanol. There is enormous cross-
cultural variation in the way people behave when they drink alcohol. … In …
the vast majority of cultures, … drinking is not associated with these
undesirable behaviours … Alcohol is just a morally neutral, normal, integral
part of ordinary, everyday life – about on a par with, say, coffee or tea. …

This variation cannot be attributed to different levels of consumption. …
Instead the variation is clearly related to different cultural beliefs about
alcohol. … This basic fact has been proved time and again … in carefully
controlled scientific experiments – double-blind, placebos and all. To put it
very simply, the experiments show that when people think they are drinking
alcohol, they behave according to their cultural beliefs about the behavioural
effects of alcohol. …

Those who most strongly believe that alcohol causes aggression are the most
likely to become aggressive when they think that they have consumed alcohol. …
These experiments show that even when people are very drunk, if they are given
an incentive (either financial reward or even just social approval) they are
perfectly capable of remaining in complete control of their behaviour – of
behaving as though they were totally sober. …

If I were given total power, I could very easily engineer a nation in which
coffee would become a huge social problem. … I would restrict access to
coffee, thus immediately giving it highly desirable forbidden-fruit status.
Then I would issue lots of dire warnings about the dangerously disinhibiting
effects of coffee. I would make sure everyone knew that even a mere three cups
(six “units”) of coffee “can lead to anti-social, aggressive and violent
behaviour”, and sexual promiscuity, thus instantly giving young people a
powerful motive to binge-drink double espressos, and a perfect excuse to
behave very badly after doing so."

<http://www.bbc.co.uk/news/magazine-15265317>

~~~
talkingquickly
Although many studies have shown that people given a placebo will often behave
as if drunk, this doesn't prove that the effect of alcohol is purely
psychological. Although people will begin to behave as if drunk, my
understanding is they will tend to behave in a manner which they would
normally feel slightly inhibited from.

When someone has actually consumed alcohol they will be more likely to perform
actions which there is a high (rather than medium as with the placebos) social
pressure against.

I can see the coffee example working for both consciously using alcohol as an
excuse for socially unacceptable behaviour and the type of results seen when
placebos are given but not the more extreme responses associated with higher
intakes.

Old paper but a good one is The Psychology of Drunken Excess
(<http://psycnet.apa.org/journals/psp/48/1/18/>) but afraid I don't think it's
available without paying.

------
JackWebbHeller
Reminds me of this XKCD, aptly titled "The Ballmer Peak":
<http://xkcd.com/323/>

~~~
micheljansen
I have noticed a similar effect in other areas myself. On example is bowling.
Sober, I am terrible, but after a few beers I rock the lane; right before I
start to wobble and fail to hit even a single pin :P

~~~
BSousa
I have the same problem with pool. Usually before the second pint I'm crap,
2-3 is the sweet spot, after that is downhill.

But damn, I used to be in a couple leagues and those 2 pints really put me in
the zone.

~~~
mafro
Pool and bowling will both improve after a couple of beers - your muscles will
relax and you'll start to throw/shoot straighter. It's all technique with
these two sports.

I don't need to point out too many beers will affect your technique in an
equal and opposing fashion..

------
glenbo
I work at a startup that has an amazing office, with a full bar and eight taps
for draught beer. This makes it easy to knock back a few while coding
throughout the day/night. I'd dare say, that the availability of free drinks
coupled with a culture that promotes drinking as a social lubricant is just
about the most tempting atmosphere possible.

Surprisingly, people do not take advantage. I think some less mature people
may like to brag about how much they can code whilst drunk, but it's just like
any other drug: If you can do X, Y, and Z incredibly well while under the
influence, odds are you'd do even beter while sober.

If you can "get shit done" while drunk b/c you're no longer afraid of the
awkward situations, odds are you'd do even better at handling them sober.

We've never had an awkward situation where someone checks in epically bad code
due to being sloppy-drunk that I'm aware of, but that's b/c people are largely
self-policing and they realize that what you an manage to do drunk, you can
dominate sober.

I don't wish to sound like a prude. We do enjoy the refreshments, but usually
after-hours, or at least when doing exploratory R&D, perhaps playing with a
new design. To do your best work on the most important projects at a startup,
you really to to bring your "A" game.

------
jpdoctor
> _But I think that doing some of the shittier tasks around a startup is
> easier after a few drinks._

And when you realize that the drinks are just an excuse, you will be one step
closer to enlightenment.

~~~
tptacek
I don't think this is a fair comment at all. Drinking definitely does alter
distractibility.

~~~
enneff
I think jpdoctor has a valid point. The brain is highly suggestible. It's
possible to trick yourself into feeling sad, happy, irritated, bored, excited,
or any other state of mind. I could probably conjor up the kind of carefree,
impulsive state that alchohol induces just by mindfully directing my thoughts
for a few minutes.

------
droithomme
This is a pretty interesting article, it's sort of taboo to discuss this in
engineering, whereas in business and politics the function of alcohol in
getting things done is taken for granted.

Like that author, I also find it much easier and faster to deal with
uncomfortable emails when drinking. I also am able to crank out dreary but
needed documentation, and it's also when I generally write proposals and cover
letters, things with a social component to them needed. It's very helpful and
saves a lot of time, just don't go overboard.

------
spxdcz
For those who didn't spot it, I assume that the title of the post is a take on
the quote attributed to Hemingway, "Write drunk; edit sober."

------
phzbOx
I used to say: "There's nothing wrong about coding while being drunk, just
don't commit!". But now, it'd be more "There's nothing wrong about coding AND
commiting while being drunk, just don't push it!"

~~~
X-Istence
You can push. I do. It just goes up to the server into my personal "clone" of
the actual project. The Ci server can then pick it up, run it's thing and I
can see output from that and then decide whether or not I want to file a
merge-request into mainline.

------
Swizec
Just don't get too drunk.

A theory floating around HN a couple days ago was that a few drinks help you
focus because they are a tax on your mind. It makes your mind disregard
distractions (like second thoughts etc.) because otherwise it simply couldn't
function.

~~~
barrkel
I don't find alcohol helps me at all; it takes an edge off me for several
days. I very rarely drink, almost only at special occasions and then matched
wines with meals and that kind of thing.

But I do find that being somewhat tired helps me get into a certain kind of
"getting things done" zone: when the creative planning is not necessary, and
mostly the grunt work of pushing things through to implementation remains.

~~~
tptacek
Being tired makes it easier for me to do public speaking and sales
presentations. I've never locked up in the middle of a presentation when I've
had a bad night's sleep beforehand. It's almost getting to be something I
optimize for: set up travel so I'm as tired as possible before presenting.

~~~
adbge
Heh, yes, I can confirm this. The one time we met you said that you weren't
sleeping well (since school had just started) and, as a result, were talking
more than usual.

Whenever I'm low on sleep, I'm mostly just irritable and more prone to making
mistakes, although once, when particularly sleep deprived, I found myself
reading the back of a shampoo bottle as if it were a cooking recipe. A couple
minutes in, I realized it wasn't a recipe, thought to myself something like
"Snap out of it!" Not more than five minutes later and I was reading the
"recipe" again.

Anyways, personally. I'm certainly neither more productive nor more talkative
when sleep deprived.

------
Jd
If the problem is that you are too timid to get things done normally, the
solution is not to get drunk. The solution is to get some balls.

~~~
seb_z_lite
yeah, really! We don't need that crap to code especially. Do you think people
that do free solo or base jumping will get tipsy just to get more ballsy? no,
they get over their fears and that's much more rewarding.

------
bstar77
I've coded twice while buzzed and had great results. I think it may have done
something to curb my ADD, which led to some serious focus and feeling of
motivation- I was able to focus on problems without other distractions
floating in my mind. I figured the code quality would have suffered, but that
wasn't the case.

I rarely drink so I would not do this regularly, but I would like to find a
less destructive way to achieve the same coding euphoria.

~~~
nyrb
Maybe this is true..

people with ADD/ADHD who get lightly buzzed might have boosted their focus.

I have noticed that when I drink a single IPA beer and I can think better,
write code better, etc.

------
marshray
Reminds me of that scene in Citizen Kane where the reporter has to get
completely passed-out drunk to write the review of Kane's starlet wife's
opera.

------
jakeonthemove
Great that it works for you... I'm usually totally off the rails after a drink
- I get so relaxed that nothing can bring me back to work, I can't even talk
with people... also I fall asleep short after.

Lack of sleep, on the other hand, does exactly what you describe - I don't
anguish over every detail and just get stuff done (usually pretty well,
too)...

------
itmag
Well I'm drinking Absolut Vodka right now, but that's just 'cause I'm hung
over. Writing code is the farthest thing from my mind right now...

Seriously though, let's start a discussion about better coding through
chemistry in general. Nicotine patches? Smart/nootropic drugs? Supplements?
Preferred caffeine delivery vectors? Etc. What works for you?

Anyone tried Modafinil?

~~~
lrt
I've tried Adderall, Ritalin, etc, and sometimes I'm able to concentrate on
the things I need to get done, but unless I'm really careful about saying
focused I end up going off on tangents and writing the most amazing but
useless code for several hours.

Experimenting with crazy metaprogramming techniques, writing over-engineered
utility libraries, experimenting with new technologies, writing epic blog
posts, etc. That said, I've learned a lot about programming by going off on
those tangents.

~~~
MichaelGG
Yep - stimulants will give you amazing focus, but you need to make sure that
focus is trained on the right thing first. It's best to take them after you're
more-or-less on track, or at least committed to a plan. If you just take them
while going through a "morning routine" and haven't decided what you're going
to be doing, you can easily burn a day on tangents.

(As a third party, you can notice this behaviour in others if those folks are
prone to calling you with all sorts of great ideas and things they're going to
do today, but by the evening, they're discussing how to improve TLB cache hit
ratios for their Ruby-on-Rails app.)

But if you get on track, wow, stimulants can make an amazing amount of
difference. They're great for getting a large amount of work done, as well as
dealing with complex problems.

------
Ogre
A general piece of advice I've found helpful is "Write code like you're going
to have to fix critical bugs while drunk at 2 in the morning."

~~~
po
Just about the worst habit I get into is to push major new code live into
production and then go out to 'celebrate'. I've fixed so many production
issues on a blackberry that was ssh'ed into a server while sitting at a bar
counter that I don't even want to think about it. Now I know to push code
during the most boring times of the week and go out to celebrate the lack of
issues another night.

------
absintheslink
Just personal experience here, and you're not me so I'm sure itdoesn't apply
and please feel free to ignore it, but I did this and it was great for a
while. Then shit shows up and I start drinking to cope with problems I
should've been facing head-on instead. At the end I had to give it up
entirely. Nothing major broken in my case, thank God, but relying on the sauce
to write your emails or get you on a plane reminds me of a reflex I wish I
hadn't developed.

------
eneveu
_I've tried coding drunk. It was a disaster - even a couple of beers had me
really struggling to produce anything worthwhile. I decided coding was like
driving - you need all your faculties to work. [...] I've read things where
people brag about coding drunk, and frankly I've been jealous that I couldn't
do it. Or code tired, fuelled by nothing but pizza and coffee._

I'm reading Uncle Bob's latest book: "The Clean Coder". In chapter 4,
"Coding", he writes about his set of rules and principles for coding
(behavior, mood, and attitude while writing code). About 3 AM code, he writes:

 _The worst code I ever wrote was at 3 AM. [...] I remember feeling so good
about myself for the long hours I was working. I remember feeling dedicated. I
remember thinking that working at 3 AM is what serious professionals do. How
wrong I was! [...] The moral of this story is: Don't write code when you are
tired. Dedication and professionalism are more about discipline than hours.
Make sure that your sleep, health, and lifestyle are tuned so that you can put
in eight good hours per day._

I think this is solid advice. He later says that "The Zone" (aka "flow")
should be avoided, which is more controversial... ;)

------
ofca
That, my friends, is called a ballmer peak. there is a great xkcd comic about
this (<http://xkcd.com/323/>) as well as a great quora thread (
<http://www.quora.com/Is-there-any-truth-to-the-Ballmer-Peak> ). Just dont
take it too far when you read this :)

------
jMyles
I suppose it goes without saying that marijuana is quite a bit better for
coding than alcohol?

------
djtriptych
I agree. Remember we're all programmers, which means we all sit around
thinking about how to be perfect all the time, because it's out job, which is
a FUCKING INSANE thing for humans to do by and large, and can easily lead to
analysis paralysis.

I love approaching work from both the hyperfocused left brain and those mental
states where I'm not quite so worried about semicolons, so to speak.

------
d3vani
Great point on taking care of the monotony a few drinks in. How you're coping
with disliking flying is a whole other conversation haha.

------
deepkut
Just look out for those typos...

------
trurl
Actually, this is why proof assistants are so great. You drink a couple
glasses of champagne at someone's PhD defense reception, and you can go back
to your office and try as you may, it won't let you prove anything incorrect.

------
hmottestad
Dear ....

I admire the work you have put into our project, thank you very much for your
efforts. However at this point we would like to look elsewhere for a different
perspective. We have a certain style in mind that we do not think you will be
able to provide.

We are sorry to have to say this, but unfortunately we will not be able to
take advantage of any further contributions from you. The contributions to
date will be compensated in full.

The very best of luck with your future prospects.

Sincerely, jfkdsjfls fjdsklfj

\----INSTEAD OF-----

I'm afraid your writing style doesn't fit with what I'm looking to publish.
That's not a criticism of your style, it's just a reality. I'm sorry not to be
able to go any further. I wish you all the best and will, of course, pay you
for the the work you've done so far. If you'd like to have a chat with me
that's fine, you've got my number.

------
gordonslondon
I had my current job by sending an email to a company while being drunk,
finally i'm very happy with this job, do things while being drunk and you will
not regret it ;)

------
joejohnson
There are so many reasons why this is a dumb idea.

------
languagehacker
I personally wouldn't be bragging that I turned someone away for their poor
writing skill by using an excerpt from a rejection email that includes a comma
splice. Real hypocritical. I can only imagine that the publication he referees
has the reading level of your average YouTube comments section. Or maybe
"getting things done" drunk, like coding drunk, also doesn't work for the
author -- but being drunk, he believes it does.

~~~
djtriptych
It's only hypocritical if he also said that the editor must necessarily have
the best grammar at any publication, which is of course ridiculous. Only
grammar nerds think grammar = good writing.

