Earlier quoted context omitted.
I wonder if swearing can help "free the mind" in some way, with the "rebellion" opening up more, perhaps non-standard/out of the box, "fucking good" ideas?
or express a wide range of subtlety.
Open source code with profanity in comments is statistically better
171–180 of 221 posts
Re: Open source code with profanity in comments is statistically better
#172Earlier quoted context omitted.
That assumes that most comments contain cursing.
No it doesn’t. If any more than 0% of comments contain profanity, then on average code with more profanity will be better.
A piece of code with a lot of swear words for variable names but no comments at all would be an extreme example.
Re: Open source code with profanity in comments is statistically better
#173Earlier quoted context omitted.
Isn’t commented code no longer considered a good idea in most companies? I used to work for a bank and the policy is no comments unless absolutely necessary, because comments become out of date. Doxygen is the only real comments allowed.
It really depends on the comments. Best practice is to comment “why” something was done, not “what” is being done, or “how”. Every programmer can read code, most code should be pretty self-explanatory. But in any sufficiently complex routine, there are going to be some things that a programmer struggled to get working the first time, that they had to work around, or that was simply unintuitive. These should be commen…
I disagree about the "how", at least for challenging to read sections of code. In these instances, it is not good to assume that everyone who is reading or modifying the code is an expert in the language or problem domain, so it's good to explain to them how code solves the problem.
Explaining how the code works is very different than explaining what the code is doing. For example, something like "This code takes input sets of timestamp data and uses a timestamp keyed hash map to bucketize them by n minute interval".
That is very different than explaining how at each step you look at each time stamp and bucketize it, then generate a new time stamp bucket key and add it to the hash map.
The first approach explains at a very high level what's happening technically so that the reader can more easily understand the operations needed to accomplish the objective.
Re: Open source code with profanity in comments is statistically better
#174From 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…
It is anecdata, but I can confirm this is the case for my code. I tend to focus more on documenting the surprising code paths, not the mundane. And when my code needs to do something special because some other component (library, hardware, API) has issues, there's usually some colourful language describing the sad state of the world outside my control.
Re: Open source code with profanity in comments is statistically better
#175Earlier quoted context omitted.
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 witch…
Re: Open source code with profanity in comments is statistically better
#176Correlation is not causality. Swearing in the comments will not magically make your code better, but fixing a hidden bugs that you have been chasing for weeks will certainly make you swear when fixed.
> Correlation is not causality. I'm fond of pointing out, despite every time I get downvoted, that causation is the thing we have no knowledge of, and therefore correlation is all we have. As Feynman said about gravity, there is no how or why to gravity, as far as we know it's simply a property of matter. But of course, that means we only know that because of the perfect correlation between matter and gravity, includ…
Re: Open source code with profanity in comments is statistically better
#177Swearing in code, however, is much easier to quantify, and of course chosen to chuff up those who think swearing itself is a virtue.
It would be a mistake to draw the conclusion that allowing swearing in code will improve code quality.
Re: Open source code with profanity in comments is statistically better
#178Schrodinger's chat (room).
Re: Open source code with profanity in comments is statistically better
#179"Which idiot wrote this crap?
You did!
Which idiot hired me?"
I think this also points to the statistical significance. Code that has been worked over a couple of times and/or has been worked on by different people for all those hard and fringe problems will be better, but also accumulate more comments venting the trouble people had fixing them. It does not seem very interesting.
Re: Open source code with profanity in comments is statistically better
#180Earlier quoted context omitted.
That requires everyone to have access to the repo, and to wade through it looking for changes to the relevant area of code you're working in. That sucks.
Relying on commits also fails as soon as feature branches start being squashed. And the comments in commits can’t be modified over time. You have to hope readers “git blame” the correct lines of your code. Just use comments.
You're not supposed to change commit messages.
The correct lines to blame are the ones right there, not exactly rocket science