I can swear a lot while talking. I have never written a curse word in my code, especially professionally. Just seems odd and not useful? I wouldn't be offended if I came across one, but it seems weird to use in a professional setting? A lot of the times I have seen inappropriate words used were not in any context and were used as a "joke" when logging/debugging. So "dicks 01" or "fuck me 01" instead of a bland "check 01" or whatever. For some reason, that seems much more unprofessional than a comment like "this code is shitty but works, need to clean up."
The contextless swearing seems so unnecessary and adds nothing to the code, whereas a comment with a curse word in it reads way more human.
I try to be silly rather than explicitly vulgar for my own sanity. Having a comment about a hack that "stinks worse than expired chicken nuggets" or seems to have been "composed by a series of dartboard throws at random character sheets" is way more fun to me.
That said, I don't take issue with cursing in code that remains private to the development staff. As others have said more eloquently than I can, the issue is when it is exposed to customers who might take issue and churn. Not a good look, so for better or worse, there are professions where professionalism cozies up to sterile language.
> I can swear a lot while talking. I have never written a curse word in my code, especially professionally.
I can swear a lot while talking. I have, once or twice, written curses in my code, sometimes including curse words, especially professionally. "Within this function lie buried the bones of those intrepid explorers who came before you. It is hallowed ground, and cursed be thy soul if you re-order anything without a +2 from a priest. You have been warned."
> So "dicks 01" or "fuck me 01" instead of a bland "check 01" or whatever. For some reason, that seems much more unprofessional than a comment like "this code is shitty but works, need to clean up."
Agreed.
Context matters a lot. People say "shitty code" all the time. I don't see that as unprofessional. But "dicks01" I would probably change if I came across it in code. Not because I would find it offensive, but because it serves no purpose other than to be juvenile... and that can easily be counter-productive if the goal is easy to read and maintain code.
With respects to "shitty code", I'm not even sure that I would personally even consider the word "shit" to be a swear word in 2025. I'm reminded of the TV show on Showtime called Bullshit (by Penn & Teller). They wanted to name the show "Humbug", which was considered profane in the early 20th century when Houdini was alive and famous. But Showtime didn't like it because they figured it wouldn't land with a modern audience. "Bullshit" it was.
That said, the article even includes the word "crap" (though perhaps they are making the point that it is replacing other, "more profane" words). That one strikes me as odd. If that is considered rude and offensive, then surely "humbug" ought to be as well. Probably very culture-specific.