Live data from Hacker News

Open source code with profanity in comments is statistically better

blog.desdelinux.net

191–200 of 221 posts

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

#191

Earlier quoted context omitted.

Rorschach test for programmers: give your confident gut feeling explanation for this phenomenon. I'll do mine: there's likely a correlation between needing to maintain a professional conduct which includes forgoing foul language (you're programming at work) and writing code under time pressure where getting a product ready for release is more important than strict adherence to clean programming practice (you're progr…

> Everyone post your favourite conjecture! Places uptight enough that developers never swear in comments are uptight in other ways that lead to poor team dynamics which hinders quality.

Making people jump through hoops because reasons leads to various forms of quiet quitting.

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

#192
post #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.

Fuckin'-A

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

#193

Earlier quoted context omitted.

in procedurally written scripts, i write "what" comments as an outline or roadmap. i also use # vs // differently where the // style designates these what so i can find next to jump to next section. if i ever get away from being a solo dev and work as part of a team, there'll be a lot of unlearning personal habits

What you describe as sections seem like natural breaking points for function. Split of those section in their own named function. The names help to document, make it easier to test and the calling of the functions will give a high-level overview of the processes Ie: def drive turn_ignition() shift_gear() press_accelerator() end def turn_ignition … code end def shift_gear …

I think this is exactly right. Function names actually fulfil the role of documentation really well. I personally tend to make them long and quite verbose, like

`def start_the_car_and_accelerate`

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

#195
post #18

Possible explanation: swearing is more likely to be committed into code by people who either (1) own the code, or (2) know they're too valuable to be punished. So it self-selects. I personally have very different commenting styles between my work and personal projects. Not that any of it's good.

God save me from working somewhere that I could be punished for code comments.

Who's the narc on your team that would even point it out? It's not like HR has some commit hook on the repos filtering for this stuff...

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

#196

From the research paper: > we calculate the swear factor as the number of swearwords divided by the lines of code That's what I suspected. Assuming that most swear words will be contained in comments, what this is actually measuring is the ratio of comments to code. In other words, code that is more heavily commented is better. I think we already knew this. That said I would like to see a more critical analysis. Firs…

>...code that is more heavily commented is better. >I think we already knew this Who's "we"? In my many years of software development, I've found a very large fraction of developers use very few, or even zero comments, and it's getting worse . Just look at the posts below here: there's a bunch of people arguing that comments are useless or harmful. It's no wonder that software sucks so much these days, since apparent…

> It's no wonder that software sucks so much these days, since apparently no one believes in documentation or code maintenance any more.

I think this comment explains why software gets worse in many cases:

> Of course nowadays, this is legacy nonsense. Everything uses UTF-8 for "char", and what doesn't is broken and terrible anyway. But the old ways stayed with us, and the stupidity of it as well.

The problem is the "legacy nonsense" tends to accumulate over time & as people depend on it, takes a long time to finally remove.

> They are so hilariously misdesigned and insufficient, I can't even fathom how this shit was _standardized_.

They did their best given their circumstances & abilities. Now we must forever pay the price.

> Several decades later, the moronic standard committees noticed that this was (still is) kind of a bad situation. Instead of fixing the situation, they added more garbage on top of it. (Probably for the sake of "compatibility").

At least they tried...

> All in all, I believe this proves that software developers as a whole and as a culture produce worse results than drug addicted butt fucked monkeys randomly hacking on typewriters while inhaling the fumes of a radioactive dumpster fire fueled by chinese platsic toys for children and Elton John/Justin Bieber crossover CDs for all eternity.

Yeah! Time to get back to work...

Credit to https://news.ycombinator.com/item?id=36626018 for pointing this out.

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

#198

From the research paper: > we calculate the swear factor as the number of swearwords divided by the lines of code That's what I suspected. Assuming that most swear words will be contained in comments, what this is actually measuring is the ratio of comments to code. In other words, code that is more heavily commented is better. I think we already knew this. That said I would like to see a more critical analysis. Firs…

> In other words, code that is more heavily commented is better.

It could also be that understanding code in any non-trivial project is likely to back the developer into a corner where they become frustrated and swear at the computer.

More importantly, the lack of swearing might be a sign that the devs lack the competence to know when they are cornered.

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

#199

From the research paper: > we calculate the swear factor as the number of swearwords divided by the lines of code That's what I suspected. Assuming that most swear words will be contained in comments, what this is actually measuring is the ratio of comments to code. In other words, code that is more heavily commented is better. I think we already knew this. That said I would like to see a more critical analysis. Firs…

[deleted]

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

#200

From the research paper: > we calculate the swear factor as the number of swearwords divided by the lines of code That's what I suspected. Assuming that most swear words will be contained in comments, what this is actually measuring is the ratio of comments to code. In other words, code that is more heavily commented is better. I think we already knew this. That said I would like to see a more critical analysis. Firs…

He don't seem to use the swear factor anywhere. The actual statistical comparison (Table 3.1) is simply mean SoftWipe score of repos with swears (5.87) vs. mean SoftWipe score of repos with 4+ stars (5.41). The increase is due to 2-3 clusters of swear repos with SoftWipe score ~7.5 and ~20k lines of code. It seems like he deduplicated the repos based on URL, not content, and Github could have biased the results returned in the GitHub search, so I wonder if it is simply sample bias.

paper: https://cme.h-its.org/exelixis/pubs/JanThesis.pdf

Post reply on HN