Relevant xkcd: http://xkcd.com/323/
In all seriousness, this is a legitimate thing. When under the influence of any drug that causes mild mental delinquency, e.g. alcohol, your brain is forced to focus entirely on the task at hand, and forms a mental barrier against distractions and outside impulses. This is why developers often write their best code at night, when tired.
Any drug that reduces your inhibitions will also open your mind to new ways of approaching problems, which often leads you to find novel solutions, even if they may be a little hacky.
Of course, abusing a substance to a level of overindulgence will render you unable to properly use a keyboard, let alone write functioning code! :)
Comments