Live data from Hacker News

Open source code with profanity in comments is statistically better

blog.desdelinux.net

161–170 of 221 posts

Re: Open source code with profanity in comments is statistically better

#161

Earlier quoted context omitted.

I never write comments, and I think they typically have a negative correlation to quality (this code is so f**ed up, plain english is, of all things, more clear and precise than code!). Unless you are releasing code publicly, and you are documenting the public API, I've never seen a valuable comment. I've seen plenty of harmful comments. However I wholeheartedly endorse using this otherwise useless but common languag…

you've never seen a useful comment?

I've been doing this for 20 years, so maybe? But I can't recall a single one excluding painstakingly maintained documentation for a public api where the source isn't readily available. I usually try hard not to read the comments and just read the code because comments are wrong so often.

Re: Open source code with profanity in comments is statistically better

#162
My Hypothesis

1. Passionate developers often swear more often when they feel safe to do so

2. Developers work better in a "safe environment" where they are not judged / forced to follow other guidelines by social or employment pressure.

And another point : those places where it's unsafe (often due to managerial micromanagement) are miserable places to work. That can drive away skilled developers or suppress them if they remain.

All this is assuming the research metric is real, though I'm not sure it is. If the metric for "code quality" is actually "precision following a coding standard" you'd have though that rigid adherence to procedure would lead to a higher score?

Re: Open source code with profanity in comments is statistically better

#163
post #130
post #62

Earlier quoted context omitted.

That's an idiotic policy and definitely not something that is industry standard. Code gets out of date as well, so let's just stop writing it altogether..

If code is wrong or out of date, the program will fail or stop doing that it's supposed to do. If comments are wrong or out of date, it will mislead the developer or at least confuse them if the comment says something else than the code. A wrong comment is worse than no comment - and usually developers don't care about comments as much as for the code. Why comment some code anyway if the code is easy to read? The onl…

The identifier can become out of date. The common argument against comments is that they're an indicator that you should factor that block out into a function with a descriptive name, but I can say for certain that method names can easily become out of date. As for doing neither, well at the end of the day you probably do want a way to summarise a block of code to the next human, rather than requiring them to read every statement

Actually, speaking as someone's who's been generally critical of the "get AI to write our PRs!" thing, having an AI attempt a quick sanity check of comments near where your edits are could maybe work well

Re: Open source code with profanity in comments is statistically better

#164
post #139

Earlier quoted context omitted.

"Why" is a really good way to put it, like you say - doing "What" just repeats something a novice, possibly even a layman, could distinguish. I tend to treat them like a strange hybrid of a story with editor's notes. Here's where we're going... but oh no! Something is in the way. We need this critical, but painful to acquire shovel. If I anticipate even the slightest bit of refactoring around it, I'm noting what devi…

> "Why" is a really good way to put it, like you say - doing "What" just repeats something a novice, possibly even a layman, could distinguish. And "profanity" in code is almost by definition a "Why"-type comment. You don't get upset and leave a profane comment unless you did a deep dive and realized the code does something absurdly horrible that took you far too long to figure out.

Yeah. It's deep-dive "oh God it's all terrible isn't it" discoveries, often containing some of the cursed knowledge that was obtained, not

    // this shit implements fizzbuzz
    fizzbuzz()

Re: Open source code with profanity in comments is statistically better

#165

My Hypothesis 1. Passionate developers often swear more often when they feel safe to do so 2. Developers work better in a "safe environment" where they are not judged / forced to follow other guidelines by social or employment pressure. And another point : those places where it's unsafe (often due to managerial micromanagement) are miserable places to work. That can drive away skilled developers or suppress them if t…

Absolutely. Passion and trust → swearing and quality.

Re: Open source code with profanity in comments is statistically better

#166

Earlier quoted context omitted.

Not that commenter, but with 20 years of experience in open source I share their hypothesis. Language policing slows down technical progress, very significantly I would wager.

Agree. You'll never get a count of all the people who may have been interested in contributing to a project but decided against it because of a COC or language police.

Yep. I keep noticing that places which tell everyone how "inclusive" and "welcoming" and "safe" they are have a strong correlation with being hostile, unsafe spaces where you're walking on eggshells with the implicit threat of dogpiling and vicious character attacks. Nothing says "friendly" like a big list of rules on the front door, and being told "you can feel safe here because we support hunting those unsafe witches!". This applies well beyond just FOSS projects

It's sort of like the stock horror media trope where a community that projects a facade of being a happy utopia is maintained by unspoken but vicious enforcement of conformity

Re: Open source code with profanity in comments is statistically better

#167

Earlier quoted context omitted.

I remember a day at a previous job when our CEO came in and told us we weren't an early stage startup anymore and had to start acting like it. Remove profanity and inside jokes from the code, and no more Quake during lunch breaks. Morale took a big hit that day.

if a CEO did that to me I'd just tell him to pull the stick out of his ass. none of it has anything to do with maturity. but I'm relatively old. you can Quake (or Overwatch or whatever the current game is) during lunch breaks at every FAANG, for christ's sake. (it's different if you're playing it during working hours.)

Yeah. Joking around helps build camaraderie, and makes people want to stay working there. I'm not sure who or where these hypothetical pearl clutchers, who can't handle a codebase with jokes or a bit of swearing, are, or why management care so much about them hypothetically encountering the codebase and getting upset. Sanitising everything and making it family friendly just makes workplaces even more soulless, rather than letting us have a bit of character in our work. At best it makes you look humourless, and at worst it can make people feel anxious about causing offence, if it's particularly strict policing

Re: Open source code with profanity in comments is statistically better

#168

Earlier quoted context omitted.

Swearing in the comments is for goodie goodies. Bad assed programmers swear in public apis like class names, functions, variables, and documentation!

The best programmers I've worked with swore at their coworkers regularly, but never in their code. They were not great people, and I'd happily kick them in the face if I would encounter no legal or professional repercussions, but, there definitely does seem to be some correlation (in my experience) between being abrasive and being a skilled programmer.

Swore at or swore while talking to? There's quite a big difference. I don't see profanity as inherently abrasive, and some of the biggest dickheads I've met in workplaces didn't swear much at all (some were of the Professor Umbridge type, so kept up an air of perfect professionalism)

Re: Open source code with profanity in comments is statistically better

#169
post #139

Earlier quoted context omitted.

"Why" is a really good way to put it, like you say - doing "What" just repeats something a novice, possibly even a layman, could distinguish. I tend to treat them like a strange hybrid of a story with editor's notes. Here's where we're going... but oh no! Something is in the way. We need this critical, but painful to acquire shovel. If I anticipate even the slightest bit of refactoring around it, I'm noting what devi…

> "Why" is a really good way to put it, like you say - doing "What" just repeats something a novice, possibly even a layman, could distinguish. And "profanity" in code is almost by definition a "Why"-type comment. You don't get upset and leave a profane comment unless you did a deep dive and realized the code does something absurdly horrible that took you far too long to figure out.

> You don't get upset and leave a profane comment unless you did a deep dive and realized the code does something absurdly horrible that took you far too long to figure out.

This describes my profanity use in comments perfectly. I'll even increase the amount of profanity and "descriptive phrases" depending on the frustration level I peak at.

Fun fact: my profanity will always be formatted into proper, grammatically and contextually correct sentences. This seems counterintuitive.

I'm curious what kind of profanity other people use; whether anyone else has an oddly specific format or if it's more off the cuff. (fyi: edited to not be cussing on HN, there will be a 100% chance my first profanity will be :"f###ing bulls##t," this is usually enough. In more severe cases I'll generally add: "bloody h3ll," "raging dumpster fire," "dumbest s##t ever," "d#mnation! h#llfire!," and, when I've completely lost my s##t, "what in the actual f###ing s##t is this g##d##n f###ing bats##t f###ing insane s##tshow clusterf##k!"

It saves a lot of time down the road to know whether I got pissed, super pissed, pissed af, threw some random s##t, or "welp, it's 5 o'clock somewhere."

Re: Open source code with profanity in comments is statistically better

#170
post #15
post #5

I'd bet a lot of the non-profanity code is people open sourcing code just to be impressive on resumes or for school, where the profanity code is probably real code. Sounds likely to be a classic case of correlation != causation

I remember there being a startup in the Dotcom era, I forget the name but for people familiar with Cambridge, MA it was where the IDEO is now. They were notorious for a few things, but one of them was writing open source software with a lot of profanity. I thought this was cool, and was talking excitedly about it to my boss and some of the senior devs. They were less amused. Cut 20 years later and I too am less impre…

Swearing for the sake of it does look childish, yes. I've noticed that in a few streaming TV shows, where they've gotten too excited over a lack of censorship that they just end up looking like teenagers who still think saying "fuck" is an act of rebellion

On the other hand, I'd like to write something like "this is a bit shit but will be replaced later" because that's how I naturally speak. Sanitising it to "crap" or "poor" just makes me feel like I'm teaching a youth club or something, and it is a minor pipeline stall in my train of thought while I do a mental synonym search

Post reply on HN