Hashing it Out? Understanding Psychoactive Substance Use in Programming Madeline Endres ZEESHAN: All right. One minute warning... one minute warning... warning! All right. Let's do this! All right, all right, all right! Let's do this talk! Cool. Oh, there's the jam... jam... cool. All right. Well, got another talk lined up for you this afternoon. So, you know, as programmers, we spend a lot of time thinking about state when we're writing code. And our next speaker thinks about the state of programmers when they're writing code. Madeline Endres is currently a Ph.D. [No audio] -- MADELINE: Can everyone hear me? Excellent! Okay. So, my name's Madeline and I'm a Ph.D. student at the University of Michigan. And like many of my fellow speakers today, I'll be talking about something that's a little bit off the beaten path, but still, I think, really interesting. The intersection of psychoactive substances in programming. And I'll be talking a little bit about some of the general background on this intersection. Why we might want to study this at all. And then diving into some of my recent research which is a case study specifically on cannabis. And talking a little bit about future directions for this work. Okay. Perhaps surprisingly, and also perhaps not surprising, programming and psychoactive substances have a long history together. Back in the '50s and '60s, the Bay Area in California was not only the site of the beginnings of the personal computer, but also it was a site for psychedelics research. Many computers, including Douglas Engelbart who invented the mouse, have talked about uses LSD. To think about the computing systems in a new light. As stated by John Markhoff in his back, what the dormouse said, check it out. He said that the computer technologies that we take granted today owe their shape to the '60s counterculture, which was defined by protest, experimentation with drugs, countercultural community and anarchic idealism. The connection between psychoactive substances and programming remains strong in the popular Zeitgeist to this day. People talking about programming while using drugs online, to people comparing programming to using drugs. To people -- to Steve Jobs saying that L is (D was a profound experience and one of the most important things in his life. To talking about micro dosing culture in Silicon Valley. People definitely have opinions on this. Some people are quite positive. And other people have, and I quote, call it a truly revolting Silicon Valley trend. So, divided opinions. And then also, to memes such as this very well-known XKCD comic, the peak, a relationship between blood alcohol content and code quality. Unproven to my knowledge. But it's out there. All of these together point to anecdotal evidence connecting programming and psychoactive substance use. However, there's really very little empirical reach, studying psychoactive in software, what people -- opinions are and let alone -- and I hope to do this a little bit more with my research, including the paper I'm going to be talking about today. Okay. So, this is just a quick outline of the talk. I already briefly said it. But we're gonna move into why study this at all? Okay. Before we go too far in this talk, we need to define what a psychoactive is. Most of you have a general idea. This helps us get all on the same page. We're gonna define a psychoactive substance as any substance that influences the brain or nervous system and thus behavior, mood, perception or thought. Things like alcohol, cannabis and caffeine are psychoactive substances. Broadly divided into two categories, those prescribes, antidepressants or anti-anxiety medications. And those more commonly used recreationally, such as alcohol or cannabis. There's gray area. Some can be used for multiple things. A big one to call out is prescription stimulants. Might treat conditions like ADHD, but also recreationally to increase focus or productivity. Things like that. But it's still a useful sort of divide to think about. In this talk, I focus mostly on recreational substances. As these are the substances that are most likely to be illegal, stigmatized or the target of any anti-drug organizational policy in software. But I think thinking about prescription medications is something worthwhile to do as well and is an interesting area for future work. Okay. So, with the definitions out of the way, let's now talk about why we want to study this intersection or why I find this intersection so interesting. So, currently it hasn't been really studied that much. Perhaps because of the legal and ethical challenges of conducting research on it. However, this is some compelling reasons for studying this intersection at all levels of software development. So, we can start at the individual level. To start this off, we're gonna have a little bit of audience participation. How many of you have ever or know a friend who has ever programmed while using a psychoactive substance? Okay. Yeah, I see a lot of hands. Yeah. What about how many people in this audience have ever or have a friend who have done that while working on work-related code. Okay. Still a lot of hands. Okay. Cool. So, it does look like programmers use psychoactive substances. But these impacts might not be really well understood outside of anecdotes or things you might see online. And I think this is an important area to study, both for programmatic reasons, helping developers make informed decisions about using psychoactive substances while programming, and also for scientific ones, pushing or understanding how substances impact programming from anecdotes to fundamental knowledge. But beyond this individual level, the impacts of psychoactive substance use may extend to the cohesion and productivity of the local team. For example, do developers who use psychoactive substances face stigma or need different types of support? How does the culture aren't psychoactive substance use in software influence employee well-being? Or are psychoactive substances ever disruptive in the work place? Does it lead to conflicts in the work place? And then even broader level, there's impacts on organizational policy. So, for example, our current drug policies in software or software-related jobs, necessary and effective. And a lot of software jobs don't have drug policies. But for a lot of programmers, you might be at a job that has like a federal contract or might have other sorts of things where there are implications there. And in our research, we found about 30% of programmers have had to take a drug test for a programmer-related job. Usually as onboarding hiring at some sort of point. Do these policies impact software-related hiring and retention? Something people are thinking about and want to make sure is going smoothly. And we want to know how these things might influence with remote work, which is becoming increasingly prevalent in our industry. And then also, there's kind of a nuance there about how should software drug policies navigate legal restrictions or deal with potentially laws that might not mesh with what the company wants to do? All of this. And in this talk, I'm gonna focus on some initial findings around these first three. That's ton more to do, and I'm definitely not going to answer all of these questions in this talk. But in the future, I also want to encourage people to study beyond this. Beyond software development itself into the intersection of psychoactive substance and technology in more general context. There's more broad implementations, health privacy or user interface. If you're working on security CAPTCHAs while you're high, can you do them? Things like that. Or accessibility in digital communities. So, with these reasons in mind, we're now going to move on to the next section of the talk. Where I'm gonna share some of my research which helps scope the potential impact of psychoactive substance use in software by looking at the prevalence of substance use by developers of various substances. Okay. So, this data that I'm going to be talking about comes with the survey that I'm going to be talking about in more depth later on. But it's a part that wasn't published in that initial paper. You guys are getting a preview. Very fun. But this was data from 800 programmers collected primarily through GitHub and also recent university graduates. Okay. Oh, and I just want to shoutout my excellent who-authors, and my adviser, Wes, and Kevin who deals with cannabis research and chronic pain. They were helpful with the work. First of all, general substance uses. This is not programming-specific. Have you used one of these substances in the past year? And unsurprisingly, the most popular is alcohol. For both -- it's three quarters and a half in the last year. After that, things drop off dramatically. But there's substantial amounts of things like tobacco and hallucinogens and amphetamines. For cannabis and hallucinogens, it's higher than the -- software tends to skew younger, more male, more liberal. It has perhaps to do with programming culture specifically. And something we have to look into more going forward. But now what you're probably actually interested in is the usage while programming in the last year. Alcohol and cannabis are by far and away the most. A quarter of the sample. Everything else drops off again quite dramatically after that. 5% or less. Bur that in itself is interesting. But it's not really surprising that alcohol and cannabis are the most because they're used the most, right? So, if we kind of normalized this by the number of people that use each substance? This is the percent of general user who is also use it while programming. And we see that alcohol and cannabis are pretty similar. Around half for each also use it while programming. But I do want to draw your attention to amphetamines with had which I think is very interesting. Not very many people in the population as a whole use amphetamines or prescription stimulants as a form of amphetamines. But for those who do use it, people are likely to use it while programming. It might be because it's prescribed for ADHD. Or it might be particularly helpful for software-related work. I think that's another direction worth considering in the future. Okay. So, now we get to jump into some of my recent work which is a case study specifically on cannabis. And we're gonna go into a bunch of details here. Okay. So, cannabis is the world's most commonly-used illicit substance. Used by 192 million people in 2018 and more than that now. As many of you know, if you don't, that's okay, as many of you know, cannabis is used for many reasons, medical and recreational. Medical reasons might be for pain relief or to relieve anxiety. recreational might be altered consciousness, or social cohesion. Oh, there's that. Okay. So, also, cannabis' legality is changing rapidly. Many countries around the world such as the UK, Canada, Colombia, Malawi, have legally taken steps towards legalization. In the US, a lot of states legalized cannabis medically or recreationally. I heard in my cab drive here that Missouri is planning on a vote for, I think, recreational legalization in this upcoming thing. It's really changing rapidly. But it remains illegal in the United States at the Federal level. Okay. So, intriguingly, there's a large amount of anecdotal evidence connecting programming and cannabis. In particular, there are hundreds of forum and blog posts on sites such as Reddit and CORA talking about cannabis use while programming. Some posters are asking questions about the feasibility of using cannabis as a professional programmer. In response, some share their own experiences using cannabis while working in software engineering. For example, this developer says they smoke and code every day and it's -- wrong one, yeah. Oh, is this someone? Yeah, that's totally that one. They're fun. Smoke and codes every day, and the smartest people they know smoke pot. This poster claims that there's something about the brain of a programmer that can be enhanced by THC. And then talks about some other stuff. There's also negative opinions. This person, for example, is saying that they attempted to program both high and drunk, but neither worked well for them. They might think they write good code, but wake up the next morning. That wasn't me. That was my dog. My dog came in, yeah. Other people think it can be used, if used responsibly, as a good tool in certain situations for programming. Relieve stress, increase enjoyment, things like creativity as well. Anecdotes like these illuminate a cannabis-related sub culture in programming that's complex and definitely not uniform. However, as with general psychoactive substance use that we talked about earlier, for many programming jobs, cannabis use can conflict with anti-drug policies. In the United States, this is especially true for jobs that rely even partially on Federal funding. It's kind of small. But parts that are important. Here's an anti-drug policy from Cisco. Employees are not permitted to use or be under the influence of drugs during working hours. And it explicitly calls out marijuana. While certain jurisdictions may have legalized, it also applies to marijuana because it's illegal Federally. This includes say for remote work. Additionally, as mentioned earlier, we find that almost one-third of software developers have taken a drug test for a programming-related job. And the conflict between cannabis using and jobs can lead to hiring shortages for companies who drug test. Probably the most popular version of this was the FBI a few years ago saying that they couldn't find hackers to hire because they all smoked pot. They recently said they can find hackers now, but I'm not sure how much I believe that, question mark. Yeah. Yeah. There's that. Okay. So, despite this apparent conflict, surprising little basically until this work until my knowledge no empirical research had been conducted on cannabis use in software development. In fact, it remains unclear if, when, or why developers use cannabis while programming. And as a result of this knowledge gap, tech companies cannot effectively evaluate existing anti-cannabis policies. In this talk, I'm gonna present research that starts to close this gap by analyzing the results from the first large-scale empirical study of cannabis use in software. Data from 803 programmers, the ones they mentioned earlier, including 450 who work full-time in programming-related jobs. When I'm deep diving into this particular talk, go into survey methodology, results on cannabis use and software. And that's the main bits. Okay. So, our goal was to understand if, when, and why developers use cannabis while programming. And to do this, we designed a 15-minute survey which included questions about demographics, programming background, cannabis usage history, and experiences using cannabis while programming. When possible, we used validated instruments. To measure cannabis use from our coauthors who are cannabis researchers and things like that. To obtain our survey population, we sent emails to US-based developers from GitHub projects, popular GitHub projects. As well as to current and recent graduates of the University of Michigan. We mostly aimed at recent graduates. So, we got people that were primarily already working in industry rather than senior Devs. We reached out to people that were enrolled a few years prior, basically. We scoped this initial investigation to the United States just because things might drastically -- be different in didn't countries. But future work, I hope, will look into more broad-scale differences. I want to note, selection bias is threat to take into consideration. Additionally, because of the legality implications of cannabis, we have to be very sure that we -- ethically. So, we had to be anonymous and confidential and we had checks to make sure data validity was still high. These are important things to note. But even so, I think the results can give a glimpse of the use of cannabis using patterns in software. We received 803 valid responses. 440 from GitHub and 339 from Michigan, and 24 from social media. Which is me Tweeting. But that's not very many. I don't have that many followers. Yeah. Now, I definitely got some fun responses to the email that weren't like survey responses per se. One of my favorites was just this person that responded with, nice try, FBI. Smiley face. [ Laughter ] And I died on that one. Yeah. Yeah. Overall, however, 83% of our valid participants were men, 14% were women. Which potentially unfortunately kind of measures with the soft care engineering overall. Or at least our recruitment population. And the ages range from 15 to 70, with 56% having a full-time programming job. Respondents had a large diversity of job titles. Most common was software engineer or developer. People could pick multiple titles, that's why it didn't add up to 450 specifically, systems engineers, researchers, instructors, data scientist. We had a pretty large list and range of job descriptions. Okay. Now we can jump into the exciting bits. What did we find? So, to start, do we find that people use cannabis while programming? And if so, how often? So, we find that around one-third of our sample have tried cannabis while programming at least once. And this is around half of those of our population who have ever tried cannabis. Additionally, this cannabis is cannabis that does contain THC. Cannabis has a lot of ingredients, but the two main ones are THC and CBD. THC is detected by drug tests. Programmers do typically use products that contain that. This is interesting, but if you have tried cannabis one time in the basement, that doesn't mean much for programming. We want to know how often they are using cannabis while programming. Of these cannabis using or trying programmers, about half of them program with cannabis regularly or semi-regularly. These once a month. 11% of them do it on a near-daily basis. The way drugs affect its work, if you're using cannabis on a near-daily basis, you're going to get detected unless you stop for the drug test or do other cleansing actions which people look up online. So, there is going to be some sort of intersection there. Now, while this is not a random sample, for sure, we do note that we observe higher cannabis usage than surveys. This is driven by demographic trends in the programming population. Okay. That's cool. But how does this differ between different demographics and our population? So, first of all, we find men are more likely than women to use cannabis while programming. This aligns with national surveys. But it's a significant result. About a 10 percentage difference. We find that transgender participants are more likely to use cannabis while programming. Also a very large different, again, smaller sample size, which is why the P value is higher. But it's still significant after multiple comparison correction. We also find a very weak correlation between age and cannabis. So, people that are older more likely to use it. When we plot the data, there's a peak at 28 to 35. The oldest people were less likely to use cannabis, and the youngest were less likely. 28 to 35, it was a little bit higher there. And then finally, this one actually kind of surprised me. But I found GitHub participants are more likely to use it while programming than university students. I totally thought students would be using it way more than people who are putting code that's used by developers out there. But that's not the case. And it's a pretty decent size difference. This may indicate that cannabis use is particularly prevalent in open source communities and I think is an interesting direction to investigate. Okay. So, the summary for cannabis prevalence. One-third of our sample of 803 have used cannabis while programming. Half currently use cannabis at least once a month, and 11% use almost daily. These are rates that will be detected or would be detected by a drug test unless behavior changes were made by the developer in question. And then cannabis use while programming is particularly common for non-binary or transgender participants and participants recruited from GitHub. Okay. So, programmers use cannabis. Cool. But when do they use it? Do they mostly use it for personal projects in the basement? Or for work-related tasks? We find, kind of as expected, most programmers choose to use if for personal projects. But there's a non-trivial amount that choose to use it for work-related projects as well. This is something that does significantly increase if you're working remotely. So, developer who is work remotely use it more, basically, for work-related tasks. The least likely were for deadline-critical tasks or things that had it get done immediately. This is cool. It shows when developers are choosing to use cannabis to some level for specific software engineering tasks. So, up on the screen, I have a list of a bunch of common software engineering tasks, ordered from those where people are most likely to use cannabis to the least. We see differences in the types of tasks. The ones they're most likely to use it for, brainstorming and prototyping. These are often associated with creativity or openness of thought or finding new directions. Things that people are less likely to use it for, these are things that might be safety, time-critical or things that involve interacting with others. Like retirements elicitation or quality assurance, or, again, tasks with imminent deadline. This is stronger evidence that developers, at least a lot of them, tend to self-regulate their cannabis usage. Using it for specific tasks, but not so much for others. Which might indicate that anti-cannabis policies may not be the level of discrimination, if they're blanket anti bans that we want. But it's worth investigating. In context, cannabis is common during personal programming projects. Some amount also choose to use it for work-related tasks. Something that increases when developers work remotely. Programmers self-regulate their cannabis use. And they're more likely to use it in software tasks than they are time-critical tasks. Okay. So, we know if they use it, we know when they use it. But we also want to know why they use it. So, I'll spoil the answer here but then I'll give some more details. The main reason is primarily for enjoyment and perceived programming enhancement. I thought wellness-related motivations were going to be more common. But they weren't that common in the sample compared to enjoyment or perceived programming enhancement. The most -- the number one was to make programming tasks more enjoyable. 60% of responsibilities say that's that they use cannabis. To think modify creative programming solutions, the word "Flow state" came up a lot in our data. The least common reasons that we have here are things like to mitigate programming-related pain or non-programming-related conditions. These were all much less likely. 15% or lower of our sample. But that's all well and good. But I think it's sometimes fun to hear the words from people. I'm going to go through a series of quotes. We'll start with some of the positive ones, move to some of the negative ones to see what people are using about cannabis use while programming. A lot of people had themes of creativity through their quotes. For example, this participant says that they're better able to connect ideas and think about thing on a broader level, which leads to more well-rounded solutions. This participant thought a similar thing that says it helps them organize their thoughts and follow new paths. Other participants were thinking more about it helping with tedious tasks or focus. So, this particular person said it used it to stay awake or focused when grading programming assignments. They say it's easier to keep going if you periodically get high. When your life is mostly work, cannabis is something that makes it bearable. Yeah, we can unpack that later, maybe. Yeah. A few more positive ones before we get to some of the negative ones. This person says, drugs are not to be used for everyday coding challenges, but I have many coding breakthroughs while on low-risk, mind-altering substances. This one says I am more likely to want to collaborate, it allows me to have a better and more joyous time. I don't have any quotes for people that feel the exact opposite. And this one, I'm not sure if this is possible? Every patent I've written, I've written while high. So, take that for what you will. Now, on to some negative ones. Cannabis makes me extremely unproductive. I get caught in a thought loop. Where some line of thought will consume me and I will completely lose focus. There seemed to be a tradeoff between creativity and focus that people were talking about, or creativity and productive that really seems to go around cannabis in programming settings. This is someone talking about their co-worker who said they enjoyed smoking while coding, but always regretted it the next day since he wrote so many bugs. Ha, ha. And then people that are negative, but more from their own experiences. For example, this person says, I wish there were more awareness so I did the no have to feel so terrified about my habit being discovered and worrying whether that would impact my employment. A little bit more serious of a thing, but worth investigating how we might help developers who might be in that situation. And then we have quotes like this from a manager who said that they had a series of developers who worked for them that used cannabis who all fully believed that it made them better engineers and sparked creativity. From the outside, the results were not that way. They were less productive and less able to work well with others. And code quality issues. So, we have a lot of conflicting opinions. And this definitely motivates future observational research on the actual effects of cannabis in programming. I am currently planning to do that. We're going through ethics board approval right now. If you have dealt with ethics board, it's fun. We'll just put that out there. But this is definitely something I want to do, we're planning on doing it, and I hope people study it. That's the way to get down to the ground truth and figure out more what's going on here. As a summary for this motivation, programmers who use cannabis are more likely to be motivated by potential programming ability or enhancement or enjoyment than they are wellness. And this really motivates future work investigating if the perceived programming benefits of cannabis actually manifest in a more rigorous observational study. Okay. [Audio cut out] -- [Captioner standing by for audio] So, I think the first big thing is for company drug policies. In this research, we found that 30% of our programmers have taken a drug test for a programming job. Through onboard hiring. We found out through substantive stuff, I can't talk about it yet. It's still under review. Peer review is fun. Also, many programmers use cannabis in a way that's detected by the drug tests, but managers are largely ambivalent about cannabis usage. Does software anti-drug policies conflict with some developers? A dissonance that can lead to lower application pools and hiring difficulties for some jobs? I am planning to do, have done under revision doing work this year, but if you're curious about it, come talk to me after the talk and I can give you thoughts and recommendations about talking to people about how policies can be changed. Our results, encouraged, as I said, a reevaluation of cannabis policies in software jobs. I think there's a lot of outstanding questions that aren't cannabis-specific, but more broad in general. Of so, first of all, this the to that observational study that I mentioned earlier. Does the use of a substance such as cannabis while programming -- and if so, how? And this speaks to the comic that I shared earlier, the answer is, like, is that real? A lot of people, at least in my surveys, I think seven or eight respondents all copied the link to the XKCD in their qualitative responses. But I think actually studying it is the only way to peer through the mist of anecdotes or hearsay and see the effects on programming. If we want to make real informed policy decisions and use, having that fundamental knowledge is essential to being able to make informed decisions. I hope research can continue, for myself and hopefully others as well, to clarify some of these effects more concretely. And then also I think knowing a little bit more at a cultural level, how does it impact culture? We saw some hints of this with some people being worried about their jobs or thinking that people who use cannabis were bad at programming. There's a lot more quotes from my data that speak to this sort of thing. But understanding how substance use can impact developer communicates. For example, different substances are viewed didn't ways in programming cycles. Alcohol, for example, might be way more accepted in companies compared to something like hallucinogens or cannabis. I've talked to people who have open happy hours or things like this. But other things maybe not. Understanding these nuances, understanding how is that what we want our community to be is at the preference of others. I think these are all relevant questions to ask about the culture of software development. And then I also think, looking more into that medication rather than recreational side and what comes long as with prescription medications. Switching prescription medications can impact things. How that can relate to things like performance reviews, all this sort of stuff. Productivity. I think there's a lot of interesting questions here. By and large, encourage future qualitative and observational studies of cannabis use in programming contexts. And then also, there's some broader technological implication. So, as I briefly said earlier, the use of psychoactive substances in technology remains under-explored even outside of cannabis context. It may interact more, and other issues, including accessibility, data privacy and algorithmic bias. This is an area that I'm planning on doing a bit more as well. And come up and ask questions after if you're curious on any of this. Again, there's some things under review. Or in the background. But yeah. So, we hope this works spur more research at the intersection of technology and mind-altering substances. So, in conclusion, in this talk I've given a history of psychoactive substance use in software. A discussion of why the study of psychoactive substances in software is interesting to do and why we should study it. The prevalence of psychoactive substances? Software. And then also a deep dive into the impacts of cannabis in particular on software and cultures. And to quickly summarize the cannabis results. These were the results of the first empirical evaluation. We surveyed 8 hundred programmers, including 450 full-time developers. A third of the people have tried cannabis while programming and 18% use it at least once a month. One-third of those use when completed work-related tasks. Something that does increase with remote work which is one of those aspects of drug policies that I think is worth reconsidering. And this use is primarily motivated by enjoyment and perceived programming enhancement. Managers rarely report negative cannabis effects, but we see it in the qualitative data. 30% have taken a drug test for a programming-related job. We hope to spur future work. And you're interested in the paper, there's a QR code and a link to the GitHub. You can follow me on Twitter and look up my co-authors, my adviser, Wes, and Kevin, who is awesome. Yeah. Thanks! [ Applause ] ZEESHAN: Awesome. Thank you, Madeline. You're here all Strange Loop and around. People can kind you and ask questions. That was awesome. Thank you so much. We have a break I guess now until 4:20 for Zach Tellman.