Hash Code – Cannabis Use Among Programmers


A survey of cannabis use by programmers reveals that more than a third had tried programming while using cannabis and almost one in five do so at least once a month, motivated by a perceived improvement in their ability to enter a programming area.

This is despite the fact that anti-cannabis policies and drug testing remain common for programming-related jobs, with 29% of respondents reporting having taken a drug test for a programming-related job.

Cannabis is the source of many controversies. It has widely recognized benefits for pain relief and is a popular recreational drug for its mind-altering properties. However, being classified as a Schedule 1 drug (which defines it as having no therapeutic value and high abuse potential), its use in much of the United States is illegal, with only 17 states having it. having legalized. On the other hand, 91% of Americans think cannabis should be legal for medical or recreational use and 81% of Americans think cannabis has at least one benefit, mostly medical – and 36 US states allow the use of cannabis medical.

So far, there have been no empirical studies on how cannabis interacts with software development, a gap filled by an investigation by a team of three researchers from the University of Michigan, Ann Arbor, which will be aired at the 44th International Conference on Software Engineering (ICSE 2022), scheduled in Pittsburgh, May 21-29, 2022.

Official statistics indicate that cannabis is used by 17.5% of Americans aged 12 or older, but its use among the software developer community is disproportionately high. To quote the arXiv article, Hashing It Out: A Survey of Programmers’ Cannabis Use, Perception, and Motivation:

Cannabis use in Silicon Valley appears to be high, with dispensaries in the region reporting that around 40% of their clientele are tech workers. Similarly, a qualitative study of coding bootcamps identified “many, many [weed]” as a key supporting element

To investigate cannabis prevalence, motivations for use, and software engineering culture, Madeline Endres, Kevin Boehnke, and Westley Weimer conducted an online survey of 803 US-based programmers, recruiting participants via GitHub and social media as well as at the University of Michigan.

The demographics of the surveyed population, broken down by recruitment basin, can be found in this table:

Note: While those listed in the “University” column are those recruited from college emails, many had already graduated and therefore had full-time CS jobs. Multiple options were allowed for job status and employment and many selected both software engineer and developer.

Of the 803 people surveyed, 450 had full-time IT jobs, the majority of which can be considered programming roles. The vast majority were in the 20-35 age bracket and men outnumbered women 6:1.

The research addressed four questions and here are its findings in brief:

Q1. Do programmers use cannabis while programming? If yes, how many times?

Overall, we find that 35% (280/803) of our participants have tried cannabis while programming or performing another software engineering-related task, about half of those who have tried cannabis in general (69% = 557/803). Of those who have used cannabis while programming, 73% (205/280, 26% of our overall population) have used cannabis while programming in the past year.

In the past year, 53% (147/280, 18% of our full sample) reported using cannabis while programming at least 12 times (per month). Additionally, 27% (76/280) said they use while programming at least twice a week (100 times a year) and 11% (30/280, 4% of our sample as a whole) reported using on an almost daily basis.

The survey also found that cannabis use while programming is particularly common among non-binary or transgender participants (57%) and participants recruited from GitHub (39%).

Q2. In what contexts do programmers use cannabis?

Cannabis tended to be used more for personal, non-emergency programming tasks. The numbers here are for the 280 respondents who used cannabis during programming:280cannabisusers.jpg

Cannabis use was also more prevalent when working remotely:

We find that 52% (145/280) of cannabis-using programmers report that they are somewhat or much more likely to use cannabis for work-related tasks when working from home, compared to only 5% (13 /280) who say they are somewhat or much less likely to do so.

When asked what type of programming activity they would use cannabis, programmers reported a higher likelihood of using cannabis when brainstorming or prototyping and a lower likelihood of using cannabis when quality assurance, requirements elicitation, or tasks with an impending deadline. In the graph, it’s the blue part of the line that indicates an increased likelihood of cannabis use:

cannabis use

Q3. Why do programmers use cannabis?

Overall, we found that programmers were more likely to report enjoyment or improved programming motivations than well-being motivations: the most common reasons were “to make programming-related tasks more enjoyable” (61%) and “to think of more creative programming solutions” (53%). In fact, all reasons for improving programming were selected by at least 30% of respondents. On the other hand, reasons related to general well-being (such as alleviating pain and anxiety) were all cited by less than 30% of respondents. So while wellness motivates some cannabis use while programming, it’s not the most common motivation.

Q4. How do opinions on cannabis use programming vary among managers, employees, and students?

Regarding the perception of cannabis among respondents, the document states:

The programmers in our sample have more positive attitudes toward cannabis than the general population. For example, 91% of our participants say the use of marijuana should be legal for recreational and medical purposes, compared to 60% of the general US population in 2021. Similarly, only 5% of our population consider smoking marijuana once or twice a week to be “high risk” compared to 29% of the US population. This difference is likely explained by demographic differences in age, gender, and political orientation between the programmers in our sample and the population as a whole.

Finding no significant differences in cannabis use between managers, employees and students, there were some differences in perceptions between the three groups. For example, researchers have found that managers disapprove of cannabis less than employees expect!


More information

Hashing It Out: A Survey of Programmers’ Cannabis Use, Perception, and Motivation
by Madeline Endres, Kevin Boehnke and Westley Weimer
In Proceedings of the 44th International Conference on Software Engineering (ICSE 2022)

Related Articles

Happy programmers produce better apps

On the dissatisfaction of software developers

arXiv creator wins Einstein Prize

Pair Programming – Principle and Practice

To be informed of new articles on I Programmer, subscribe to our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook Where LinkedIn.




or send your comment to: [email protected]


Comments are closed.