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

Resignations at OpenAI. Hashtag Trending for Friday, May 17, 2024

The question changes from “where’s Ilya” to what took so long?  Did Musk’s Neuralink team know there might...

Google does the unthinkable – reportedly erasing a 125 billion dollar pension fund

It's reported that Google inadvertently erased the Google Cloud account of UniSuper, an Australian pension fund valued at...

MIT students exploit blockchain vulnerability to steal 25 million dollars

Two MIT students have been implicated in a highly sophisticated cryptocurrency heist, where they reportedly exploited a vulnerability...

iOS update brings back photos users thought were permanently deleted

After a recent iOS update, a number of iPhone users have found themselves facing unexpected blasts from the...

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