Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
194 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
46 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

High Expectations: An Observational Study of Programming and Cannabis Intoxication (2402.19194v1)

Published 29 Feb 2024 in cs.SE

Abstract: Anecdotal evidence of cannabis use by professional programmers abounds. Recent studies have found that some professionals regularly use cannabis while programming even for work-related tasks. However, accounts of the impacts of cannabis on programming vary widely and are often contradictory. For example, some programmers claim that it impairs their ability to generate correct solutions while others claim it enhances creativity and focus. There remains a need for an empirical understanding of the true impacts of cannabis on programming. This paper presents the first controlled observational study of the effects of cannabis on programming ability. Based on a within-subjects design with over 70 participants, we find that at ecologically valid dosages, cannabis significantly impairs programming performance. Programs implemented while high contain more bugs and take longer to write (p < 0.05), a small to medium effect (0.22 <= d <= 0.44). We also did not find any evidence that high programmers generate more divergent solutions. However, programmers can accurately assess differences in their programming performance (r = 0.59), even when under the influence of cannabis. We hope that this research will facilitate evidence-based policies and help developers make informed decisions regarding cannabis use while programming.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (54)
  1. The impact of personality traits and knowledge collection behavior on programmer creativity. Information and Software Technology 128 (2020), 106405.
  2. Hiring is Broken: What Do Developers Say About Technical Interviews?. In 2019 IEEE Symposium on Visual Languages and Human-Centric Computing, VL/HCC 2019, Memphis, Tennessee, USA, October 14-18, 2019, Justin Smith, Christopher Bogart, Judith Good, and Scott D. Fleming (Eds.). IEEE Computer Society, 1–9. https://doi.org/10.1109/VLHCC.2019.8818836
  3. Computing Creativity: Divergence in Computational Thinking. In Proceeding of the 44th ACM Technical Symposium on Computer Science Education. 359–364. https://doi.org/10.1145/2445196.2445302
  4. Marc Berman. 2020. How CBD Oil Can Help Programmers Focus. https://programminginsider.com/how-cbd-oil-can-help-programmers-focus/. Accessed: 2021-03-07.
  5. Pills to Pot: Observational Analyses of Cannabis Substitution Among Medical Cannabis Users With Chronic Pain. The Journal of Pain 20, 7 (2019), 830–841. https://doi.org/10.1016/j.jpain.2019.01.010
  6. Acute and Chronic Effects of Cannabinoids on Human Cognition—A Systematic Review. Biological Psychiatry 79, 7 (2016), 557–567. https://doi.org/10.1016/j.biopsych.2015.12.002 Cannabinoids and Psychotic Disorders.
  7. Mechanisms of cannabis impairment: Implications for modeling driving performance. Forensic Science International 328 (2021), 110902. https://doi.org/10.1016/j.forsciint.2021.110902
  8. Ian Campbell. 2007. Chi-squared and Fisher–Irwin tests of two-by-two tables with small sample recommendations. Statistics in medicine 26, 19 (2007), 3661–3675. https://doi.org/10.1002/sim.2832
  9. Cisco. 2019. 2019 Code of Business Conduct. https://www.cisco.com/c/dam/en_us/about/cobc/2019/english-2019.pdf. Accessed: 2021-08-09.
  10. Broderick Crawford and Claudio León de la Barra. 2007. Enhancing Creativity in Agile Software Teams. In Agile Processes in Software Engineering and Extreme Programming, Giulio Concas, Ernesto Damiani, Marco Scotto, and Giancarlo Succi (Eds.). 161–162.
  11. The Role of Working Memory in Program Tracing. In Proceedings of the 2021 CHI Conference on Human Factors in Computing Systems (Yokohama, Japan) (CHI ’21). Association for Computing Machinery, New York, NY, USA, Article 56, 13 pages. https://doi.org/10.1145/3411764.3445257
  12. Acute effects of high-potency cannabis flower and cannabis concentrates on everyday life memory and decision making. Sci. Rep. 11, 13784 (2021).
  13. Carrie Cuttler and Alexander Spradlin. 2017a. Measuring cannabis consumption: psychometric properties of the daily sessions, frequency, age of onset, and quantity of cannabis use inventory (DFAQ-CU). PLoS One 12, 5 (2017), e0178194.
  14. Carrie Cuttler and Alexander Spradlin. 2017b. Measuring cannabis consumption: psychometric properties of the daily sessions, frequency, age of onset, and quantity of cannabis use inventory (DFAQ-CU). PLoS One 12, 5 (2017), e0178194.
  15. Hashing It out: A Survey of Programmers’ Cannabis Usage, Perception, and Motivation. In International Conference on Software Engineering. 1107–1119.
  16. To read or to rotate? comparing the effects of technical reading training and spatial skills training on novice programming ability. In Foundations of Software Engineering. 754–766.
  17. Relating Reading, Visualization, and Coding for New Programmers: A Neuroimaging Study. In International Conference on Software Engineering. 600–612.
  18. The Effect of Poor Source Code Lexicon and Readability on Developers’ Cognitive Load. In International Conference on Program Comprehension.
  19. A Tale of Two Cities: Software Developers Working from Home during the COVID-19 Pandemic. ACM Trans. Softw. Eng. Methodol. 31, 2 (2022), 27:1–27:37. https://doi.org/10.1145/3487567
  20. Cognitive mechanisms underlying risky decision-making in chronic cannabis users. Journal of Mathematical Psychology 54, 1 (2010), 28–38. https://doi.org/10.1016/j.jmp.2009.10.002 Contributions of Mathematical Psychology to Clinical Science and Assessment.
  21. A human study of patch maintainability. In ISSTA. ACM, 177–187.
  22. Joseph E. Gonzales and Corbin A. Cunninghham. 2015. The promise of pre registration in psychological research. American Psychological Association (2015).
  23. Happy software developers solve problems better: psychological measurements in empirical software engineering. PeerJ 2 (March 2014), e289.
  24. Exploring the Role of Creativity in Software Engineering. In 43rd IEEE/ACM International Conference on Software Engineering: Software Engineering in Society, ICSE (SEIS) 2021, May 25-28, 2021. IEEE, Madrid, Spain, 1–9. https://doi.org/10.1109/ICSE-SEIS52602.2021.00009
  25. Reshma Hegde and Gursimran Walia. 2014. How to enhance the creativity of software developers: A systematic literature review. International Conference on Software Engineering and Knowledge Engineering (2014), 229–234.
  26. IBM. 2018. Business Conduct Guidelines. https://www.ibm.com/investor/att/pdf/BCG_accessible_2019.pdf. Accessed: 2021-08-09.
  27. Leo Kelion. 2014. FBI ’could hire hackers on cannabis’ to fight cybercrime. https://www.bbc.com/news/technology-27499595. Accessed: 2021-03-07.
  28. Cannabis and creativity: highly potent cannabis impairs divergent thinking in regular cannabis users. Psychopharmacology 232, 6 (2015), 1123–1134.
  29. The short-term and long-term effects of cannabis on cognition: recent advances in the field. Current Opinion in Psychology 38 (2021), 49–55. https://doi.org/10.1016/j.copsyc.2020.07.005 Cannabis.
  30. Neurological Divide: An fMRI Study of Prose and Code Writing. In International Conference on Software Engineering.
  31. Emily M. LaFrance and Carrie Cuttler. 2017. Inspired by Mary Jane? Mechanisms underlying enhanced creativity in cannabis users. Consciousness and Cognition 56 (2017), 68–76. https://doi.org/10.1016/j.concog.2017.10.009
  32. John Markoff. 2005. What the dormouse said: How the sixties counterculture shaped the personal computer industry. Penguin Group, New York, NY, USA.
  33. Gayle Laakmann McDowell. 2015. Cracking the coding interview—189 programming questions and solutions. CareerCup.
  34. Perceptions of Creativity in Software Engineering Research and Practice. In 2017 43rd Euromicro Conference on Software Engineering and Advanced Applications (SEAA). 210–217. https://doi.org/10.1109/SEAA.2017.21
  35. From Organizations to Individuals: Psychoactive Substance Use By Professional Programmers. In International Conference on Software Engineering. 665–677.
  36. Lemai Nguyen and Graeme Shanks. 2009. A framework for understanding creativity in requirements engineering. Information and Software Technology 51, 3 (2009), 655–662.
  37. Geoffrey Norman. 2010. Likert scales, levels of measurement and the “laws” of statistics. Advances in health sciences education : theory and practice 15, 5 (02 2010), 625–32. https://doi.org/10.1007/s10459-010-9222-y
  38. Program Comprehension and Code Complexity Metrics: An fMRI Study. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). 524–536. https://doi.org/10.1109/ICSE43902.2021.00056
  39. Ramp-up Journey of New Hires: Do Strategic Practices of Software Companies Influence Productivity?. In Proceedings of the 10th Innovations in Software Engineering Conference. 107–111.
  40. Colin Robson and Kieran McCartan. 2016. Real world research: a resource for users of social research methods in applied settings. Wiley.
  41. Ole Rogeberg and Rune Elvik. 2016. The effects of cannabis intoxication on motor vehicle collision revisited and revised. Addiction 111, 8 (2016), 1348–1359. https://doi.org/10.1111/add.13347 arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1111/add.13347
  42. M. A. Runco and S.M. Okuda. 1988. Problem discovery, divergent thinking, and the creative process. Journal of Youth and Adolescence 17, 3 (06 1988), 211–220. https://doi.org/10.1007/BF01538162
  43. Exploratory Experimental Studies Comparing Online and Offline Programming Performance. Commun. ACM 11, 1 (jan 1968), 3–11.
  44. Skipper Seabold and Josef Perktold. 2010. statsmodels: Econometric and statistical modeling with python. In 9th Python in Science Conference. SciPy, Austin, TX, US, 92–96.
  45. Mining Software Repositories. IEEE (2023).
  46. Understanding understanding source code with functional magnetic resonance imaging. In Proceedings of the 36th International Conference on Software Engineering. 378–389.
  47. Pre-registration: Why and How. J. Society for Consumer Psychology (Dec. 2020). https://doi.org/10.1002/jcpy.1208
  48. United Nations Press Team. 2020. UNODC World Drug Report 2020: Global drug use rising; while COVID-19 has far reaching impact on global drug markets. United Nations. https://www.unodc.org/unodc/press/releases/2020/June/media-advisory---global-launch-of-the-2020-world-drug-report.html
  49. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods 17 (2020), 261–272. https://doi.org/10.1038/s41592-019-0686-2
  50. Charlotte Walsh. 2011. Drugs, the Internet and change. Journal of psychoactive drugs 43, 1 (2011), 55–63.
  51. Mary Walton. 2019. Programming and Cannabis — 5 Things to Know. https://simpleprogrammer.com/programming-and-cannabis/. Accessed: 2021-03-07.
  52. Wes McKinney. 2010. Data Structures for Statistical Computing in Python. In Proceedings of the 9th Python in Science Conference, Stéfan van der Walt and Jarrod Millman (Eds.). SciPy, Austin, TX, US, 56–61. https://doi.org/10.25080/Majora-92bf1922-00a
  53. Laura Wood. 2021. Global Cannabis Market (2020 to 2026) - Emergence of Cannabis Legalization in Asia-Pacific Presents Opportunities - ResearchAndMarkets.com. Business Wire. https://www.businesswire.com/news/home/20210216005966/en/Global-Cannabis-Market-2020-to-2026---Emergence-of-Cannabis-Legalization-in-Asia-Pacific-Presents-Opportunities---ResearchAndMarkets.com/
  54. Yuki Yamada. 2018. How to Crack Pre-registration: Toward Transparent and Open Science. Frontiers in Psychology 9, 1831 (2018). https://doi.org/10.3389/fpsyg.2018.01831

Summary

  • The paper demonstrates that cannabis intoxication leads to a 10–14% reduction in test case success and 11–14% slower task completion.
  • The research employs a controlled, within-subjects design with more than 70 participants to quantify performance degradation using accuracy and speed metrics.
  • The study challenges anecdotal claims of cannabis-enhanced creativity by finding no significant increase in innovative problem-solving approaches.

Assessing the Impact of Cannabis on Programming Performance

The paper explores the largely uncharted territory of the relationships between cannabis intoxication and programming performance, one marked by anecdotal claims yet lacking empirical data. The paper systematically examines this phenomenon through a controlled observational design involving over 70 participants, evaluating various facets of programming effectiveness under cannabis intoxication compared to sober conditions.

Core Findings

The research employs a within-subjects design to assess the effects of cannabis on programming accuracy and efficiency. The results indicate significant degradation in performance attributable to cannabis intoxication, quantified by an increase in the number of programming errors and extended time periods required for task completion. Specifically, cannabis use was found to impair programming correctness, with a moderate effect size ranging from 0.22 to 0.44 and causing programmers to pass 10-14% fewer test cases on average. Additionally, programming speed suffered, with intoxicated programmers taking approximately 11%-14% more time to complete tasks, corroborating the hypothesis that cannabis slows down programming performance.

Interestingly, despite prevalent anecdotes suggesting cannabis enhances creativity, the paper found no empirical support for increased divergent thinking or innovative problem-solving under the influence of cannabis. Whether it be through divergent algorithmic choices or stylistic coding variations, the intoxicated participants did not exhibit significant differences compared to their sober counterparts. This finding challenges prevailing notions and suggests that any perceived creativity benefits associated with cannabis use do not manifest in discernible variations in programming methodology.

Methodological Considerations

The paper's robust methodological framework deserves commendation, integrating pre-registered hypotheses, ecologically valid settings, and a diverse participant sample from multiple metropolitan areas. Such rigor lends substantial credibility to the findings and facilitates generalizability toward standard programming environments. Remote, ethically sensitive arrangements ensured participant safety and confidentiality, essential given the legal complexities surrounding cannabis use.

Metrics and stimuli for assessing performance encompassed both routine and complex programming tasks, with attention to correctness (quantified through extensive test cases) and temporal efficiency. Manual and automated annotation procedures provided comprehensive evaluations of both the derived solutions and strategic approach variances. Although limitations exist—primarily due to the inability to standardize the dosage and, therefore, the degree of intoxication—the paper advances our understanding of this intersection of psychoactive substance use and professional expertise.

Practical Implications and Future Directions

The outcomes reveal practical implications for individual developers and organizational policy-making. On the one hand, developers should be aware of potential performance degradations related to cannabis use, especially in contexts where accuracy and efficiency are paramount. On the other hand, businesses must navigate the responsible formulation of cannabis-related employment policies—considering that developers correctly perceive performance declines when using cannabis, indicating self-awareness and potential for self-regulation even under intoxication. Furthermore, the moderate effect size of cannabis impairment suggests that individual performance differences may overshadow the influence of intoxication—contextual insight valuable to HR policies.

Future research could aim to broaden the investigatory scope, exploring other psychoactive substances, longer-term performance trajectories, or integrating differing cannabis consumption methods such as edibles. The potential interaction between cannabis intoxication and cognitive task dimensions like debugging, which was only briefly touched on in this paper, merits deeper exploration.

In summary, this paper provides a meaningful contribution to the discourse on cannabis use in professional settings, especially within the highly cognitive discipline of software engineering. Through methodical examination and critical evaluation, it dispels myths surrounding cannabis-enhanced creativity while demonstrating clear impairments in programming performance. This empirical evidence can serve as a foundation for further inquiry and the prudent development of related personnel policies.

Reddit Logo Streamline Icon: https://streamlinehq.com