Cursing while writing code? There is a situation where you are better programmers

by time news

Source: Unsplash

Badly rewritten code with no documentation that you need to fix because it broke Thursday night production? Unreasonable schedules? A bug in a third-party library? Bad tests? Fatal review code? Legacy code, spaghetti code? Shocking WLB?… Really there are no shortage of reasons for the nerves of keys and keys. But at least judging by new research, it seems that the worst thing you can do for yourself is to keep things in your stomach and not get them out to your IDE.

Throw some curse into the code. Maybe it will help

A study conducted by the Karlsruhe Technology Center in Germany found that developers who write obscenities in their code, or in comments about their code, are better developers. This research, a sure candidate for the Ignoble Prize if you ask us, actually started with the work of an undergraduate student who studied the code written in the C language – and found a rather surprising amount of curses in it.

He relayed the information to his accompanying lecturer, along with an interactive graph showing an analysis of all Linux source code from version 0.01 to v5.18-rc7. In this amazing graph you can see the number of times four different swear words (fuck, crap, shit and bastard) were observed in the code or in comments on the code by developers.

That lecturer, Alexandros Stamatakis, decided to use software developed in the lab he runs at the academic institution called SoftWipe. The software examines the degree of compliance with the standards of code writing and development – such as writing tests for your code and maintaining a relatively simple code structure.

The two ran the software on 3,800 samples of code snippets that included swearing, and 7,600 samples of “clean” code they pulled from GitHub. After running SoftWipe, the two found that, on average, programmers who “spoilt” their code with swear words got higher results from the software than those who kept proper language in their code. Although it is not a big gap, in the code quality index (which ranges from a score of 1 to 10) a gap of half a point was discovered in favor of the swearers.

“The results were quite surprising,” said Jan Stermahl – the student who worked with his lecturer on the interesting research. His lecturer, who admitted in a conversation with ArsTechnica that he also tends to swear when he writes code – but tries to keep the swearing out of the code, wondered if this is why he got to where he is today: “It’s very cool! Maybe that’s what helped me become a lecturer.” Causation or correlation? You decide.

You may also like

Leave a Comment