Coding Under Influence
Before talking about coding under influence it might be an idea to have a control case. Not being intoxicated while coding has been accepted as a good idea for some time. Suits at major companies would not have it any other way. Coding was not considered as something you would enjoy and the only access people had to computers was at work. Only once universities started getting computers did we realise this stuff is actually fun. The hacker culture was born and with it came the combination of exploring this new world of possibilities and getting away with it as it was not a toy for just anyone to play with. Once you find out that the stuff you are not supposed to touch is really cool, it becomes more tempting to look at all other forbidden boxes.
Caffeine is the old hacker favourite. Whether it is coffee or cola, it gives you that kick you need to concentrate. Well that's what I though until I stopped drinking it. The effects of caffeine are short lasting (4 hours or so) and you pay for it by spending the rest of your day in a zombied out state.
As for coding, it does seem to work. It lets you code noticeably faster. Unfortunately with large problems it is easy write faster than you can think leaving your code riddled with bugs.
Even though I spent some time smoking I never enjoyed it much and it never had much of an effect on me. I don't agree with smoking because you enjoy it, smoking should be there to make you look cool and nothing else.
Although some coders do like to smoke every few hours of coding the effect is not noticeable. Giving up smoking on the other hand has a far more interesting effect on coding ability. One common symptom is the ability of easily being irritated about small problems. If it is possible to keep momentum it can be ignored but when facing tasks such as debugging it becomes easy to take your inadequacies out of the computer.
Two general effects are common when coding while drunk. The first is the loss of memory for anything not being refreshed every few seconds. Getting distracted will mean you have to remind yourself what you were doing where and why, which is not always easy. The second effect is sudden realisation of the comedy value of code. This strongly links with the first effect as finding out you already wrote the function you were working on for the last hour becomes funny rather upsetting. Becoming bolder allows you to take the first step in tackling those huge code restructuring challenges you were afraid of for so long. One word of warning before drinking and coding is to backup everything. CVS is a good idea as you can wake up in the morning and realise you deleted huge chunks of code as you found them unsatisfactorily.
Possibly the most enjoyable drug to take while coding. As you write you feel this is the greatest code that has ever been conceived by human kind. Unfortunately it isn't but you don't know that at the time. It is often possible to think of the challenge from a totally different angle and solve it in a better way.
The biggest problem is being easily distracted by how cool what you're doing is. Sitting for ages thinking "We write the code, the computer runs the code, and we see the code" is fruitless.
ConclusionThe only drug scoring better then the control case was caffeine and only for short periods. Considering a good night's sleep and a stress free working atmosphere would have a similar effect it seems there is little you can do to improve your coding. Just for the record:
Good night's sleep:What about the fun factor? Well hard core coding seems only to be enjoyable if you have full control of your mind in order to be capable of doing it correctly.
I strongly advise not breaking the law wherever you live. Remember all drugs are dangerous and this article is there so you dont have to try it your self. Turning up to work drunk is not a good idea. But if you have any additions to the list I would be happy to accept them.