Sweary source code comments a sign of competence

Yeah, but that’s crap, insisting there must be some way it can be done instead of considering whether it can. Sometimes the task itself is complex. Refactoring can try to scatter that across countless simple functions, but that doesn’t mean the overall program will make any more sense without explanation – often the opposite. Especially if you ever need to know why it works the way it does.


I’m off to write a linter that warns people if their comments don’t contain at least two swears. Our code quality is going to the moon!


Fire whoever set that shit up immediately and start commenting your code - every person who works on your codebase in future will thank you.



Smash cut to me gripping my laptop and shaking it: “But whhhhhy?!”

There are a lot of things that are certainly crap (the entire SAFe model, for example). But I’m not in a position to arguing a losing cause.

1 Like

Complex code should be reduced to simpler units, sure. Something something road to Hell paved with good intentions something.

Comments still provide the big picture and are trail notes for future devs and code reviewers. Especially the sweary kind (this fucking line caused a four hour outage, see ticket FOO-1234. Do not change it)


As always, the answer is somewhere in the middle. Code comments got a little out of hand there for a while with tools like doxygen requiring massive headers on every single function call and whatnot.

The idea of code being “self-documenting” is a nice sentiment, in that it encourages good function and variable naming, as well as logical file structure that makes the architecture easy to follow.

Neither extreme is good though. Everything in moderation, as they say.


So many examples of odd code here at one of my favorite sites to occasionally peruse:


BTDT, got in trouble for doing so in an open plan office.

Only once though, so I think they got used to it

1 Like

If you’re a n00b writing code assigned to you, without the reputation or experience to be permitted to do architecture and design, you’re probably going to be more careful with commentry and variable names and so forth. But once you are recognised as a good programmer, why would you bother filtering? You can get another job easily enough, and why would you want to work for anyone who would care about swear words in source comments?

If you don’t want people to swear, why would you put them in an open plan office?
(Another awful MBA fantasy. :slightly_frowning_face:)


I’m pretty sure the thought process of the corporate nespots was “the great coders don’t want to work in our dystopian corporate hellscape so our IT sucks. We need to get hip and cool to get the talent, so let’s be just like those super cool Silly Valley startups, we will stop requiring ties and jackets and jam everybody into industrial looking spaces with exposed ducts and their elbows touching”.
It didn’t occur to them that those cool startups couldn’t afford offices or ceiling tiles, and were just doing a good job of making the best of cheap industrial spaces.


This is the great lie of open offices. They say it’s for “collaboration” but of course it’s really about controlling the second highest cost on the balance sheet- square footage. You can cram twice as many people into an open plan as you can with cubicles, and probably three or four times more than offices.


I wonder if those people will have the same opinion years down the line, after having to modify large old code bases without even an overview document.



I think it’s more likely that his premise is wrong. While stress might be a contributor to swearing in code, my experience is that people who swear in code comments tense to be people who are having fun with their job, asks people who enjoy what they do tend to care more about doing it well.

I’ve worked in this industry for a long time, and I can confidently say that stress inducing time pressures do not correlate to higher quality code with any frequency.


It’s cheaper for my current employer to let everyone continue to work from home, but if they do that, they’ll end up stuck with $4T in office space they won’t be able to sell profitably. So they are forcing everyone back into the office and hoping the rest of wall street will follow along, propping up the commercial real estate market for now.


I feel you… and at points likely caused someone else to make sweary comments about my code.

1 Like

I like to think that stock photo represents the woman smiling after having just added some truly shocking obscenities in the comments of the code she’s working on.

First there was the study that supposedly showed that people who swear a lot have larger vocabularies, now this. Call me cynical, but I think there are some expletive-flinging researchers out there looking for indirect validation.


Ah, so you’ve worked with industrial automation code… :thinking:

I’m aware of a legendary government codebase written in PL/1. Purportedly it is so dark and impenetrable that the sole developer continues to be employed in perpetuity as juniors fail, one after the other in two or three year cycles, to port it to a newer language.

I consider comments to be notes to my future self. These are often edited later with sweary comments at myself for having completely missed what it was that I was most likely to forget about in that chunk of code.


Where that “someone else” could very well be you from months or years ago. On more than one occasion I’ve looked at a piece of code, said “Why the <puzzled or profane word, depending on how bad it is> did they write it that way?” only to look back in source control to realize they was me ten years ago.

If I’m being charitable I’ll say I’ve learned a lot since then. :grin: