This Code Is $#&!

On the curious relationship between cursing and writing software

Clive Thompson
5 min readJul 9

--

Photo by Nong on Unsplash

Coding is a lot of things: Brain-teasing, challenging, fun, powerful, and thus liable to give its practitioners the occasional God Complex.

But primarily? Computer programming is deeply, agonizingly frustrating. (I’ve blogged about this before.) Computers are brutal, unforgiving taskmasters. It doesn’t matter if you think you’ve got it right: If you’ve made some tiny error — on the level of a single piece of punctuation — the computer will sit there, refusing to cooperate, coolly paring its nails, or perhaps offering error messages as inscrutable as proclamations of the Delphic Oracle. It is very easy, when programming, to feel like a total idiot, and to start cursing out loud.

It’s easy to start cursing in the code, too. It turns out that, as research has found, programmers include a lot of swear words right inside their code.

And more interestingly yet …

… some of that swearing actually might be useful.

Let us unpack this!

The first time I got a sense of how often programmers include swear-words in their code was back in the early 2010s. That was when the developer Andrew Vos decided to look at the “commit messages” on GitHub.

A commit message works like this: When programmers finish up a piece of work and upload it to GitHub, they customarily add a short textual description of what they did.

Vos analyzed 1 million commit messages and discovered they often contained curse words. Sometimes the developers were annoyed at their own incompetence, and were cursing themselves out. Other times they were pissed off at the lousy work of others they were being forced to fix. And sometimes they were just trying to be funny.

They wrote stuff like this …

Dunno how the fuck this was working before …

fuck it. let’s release

bunch of shit was deleted

fuck me I can’t stand this shit anymore

some fuckery with this test now. HALP ME t0m

that is some weird arity shit i don’t understand

--

--

Clive Thompson

I write 2X a week on tech, science, culture — and how those collide. Writer at NYT mag/Wired; author, “Coders”. @clive@saturation.social clive@clivethompson.net