Swearing in code improves quality, says study

Share post:

Jan Strehmel, a student in the IT department at the Karlsruhe Institute of Technology’s Institute of Theoretical Computer Sciences (ITI), stated in his thesis that “source code with profanity in comments is superior to source code without it.”

Strehmel compared examples that used any of over 300 swear words to starred repositories in over 10,000 code repositories. Using the open-source software benchmarker Softwipe to score each repository, the researchers discovered that repositories that contain swear words have a higher concentration of code at the upper echelons of the softwipe scale.

Strehmel and his colleagues quantified the coding standards compliance of these two different sets of open-source code. The results of the SoftWipe tool were presented as an indicator of the quality of the source code. The study was entirely based on C source code. The paper hypothesizes that swearing “represents an indicator of a profound emotional involvement of the programmer,” which leads to better code via a more “thorough, critical, and dialectic code analysis process.”

“We found that open source that contains profanity exhibits significantly better code quality than open source that does not contain profanity, according to various statistical tests. We hypothesize that the use of profanity is an indicator of the programmer’s deep emotional involvement with the code and its inherent complexities, thus producing better code based on a thorough, critical, and dialectical code analysis process,” the study report says. However, the team insists that this study is an observational study, as it does not control for any group of developers.

Bergen hypothesized that programmers who swear are more emotionally engaged with their work than those who don’t, which could lead to higher-quality products. Alternatively, programmers may include profanity in their code to amuse or shock people who read it—and if they expect their code to be read, they may put extra effort into it.

According to cognitive psychologist Benjamin Bergen of the University of California San Diego, swearing is likely a “symptom of something deeper going on,” and he’d like to see future research focus on the underlying cause of the association.

The sources for this piece include an article in ArsTechnica.

SUBSCRIBE NOW

Related articles

ASUS Tackles GPU Sag with Built-In Gyroscopes in ROG Strix Cards

ASUS is taking a high-tech approach to a common PC hardware problem: graphics card sag. The company will...

Duolingo’s AI-First Strategy Replaces Hundreds of Contractors in Major Shift

Duolingo, the language learning company, is moving to an AI-first operational model, replacing hundreds of contract workers with...

The SaaS Security Risks You’re Ignoring 🚨 Cyber Security Today Weekend for April 26

Support us at buymeacoffee.com/techpodcast Are you overlooking critical SaaS security risks? 🚨 In this episode, host Jim Love is...

Tesla’s Optimus Robot Production Stopped Chinese Rare Earth Restrictions

Tesla’s ambitious plans to mass-produce its Optimus humanoid robot have hit a significant roadblock: China’s tightening grip on...

Become a member

New, Relevant Tech Stories. Our article selection is done by industry professionals. Our writers summarize them to give you the key takeaways