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?
Open source code with profanity in comments is statistically better
161–170 of 221 posts
Re: Open source code with profanity in comments is statistically better
#1621. 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
#163Earlier 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…
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
#164Earlier 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.
// this shit implements fizzbuzz
fizzbuzz()Re: Open source code with profanity in comments is statistically better
#165My 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…
Re: Open source code with profanity in comments is statistically better
#166Earlier 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.
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
#167Earlier 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.)
Re: Open source code with profanity in comments is statistically better
#168Earlier 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.
Re: Open source code with profanity in comments is statistically better
#169Earlier 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.
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
#170I'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…
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