At my company, there tends to be some bad language in our code base. It's pretty common place to find F bombs in they comments. Is this normal practice?
Ask HN: Do you swear in your code?
1–10 of 82 posts
Re: Ask HN: Do you swear in your code?
#2i did in college, and also frequently used "TAMO" in comments
but then i joined a company that supplies source to customers.
Re: Ask HN: Do you swear in your code?
#3Swearing in comments is unacceptable IMO. You wouldn't write swear words in internal documents, so why do it in code. It's unprofessional and shows a level of dis-respect for your own code and for the people who might end up maintaining it. Plus, heaven forbid a client happened to see it as well.
Re: Ask HN: Do you swear in your code?
#4Always assume that what you write is read by others than you intended. That goes for code, documents, emails, and test data.
Re: Ask HN: Do you swear in your code?
#5It is a fairly common practice. That being said, it's a bad idea to allow that to stand in your code base. It never adds anything to the clarity of the code, other than the fact that you now know the developer writing it has a bad temper.
While you're in there cutting out F-bombs, you should probably do yourself a favor and review the surrounding code. Foul language in comments are almost always put in out of frustration, so you probably have some good targets for code refactoring.
Re: Ask HN: Do you swear in your code?
#6It's OK to do it in C++, if you must. It's very, very stupid to do it in HTML...
Re: Ask HN: Do you swear in your code?
#7Apparently a lot of public codes does...
Re: Ask HN: Do you swear in your code?
#8Fuck yes it is.
Re: Ask HN: Do you swear in your code?
#9Sometimes, but usually only in code I'm using to wrap my head around a new concept that I'm struggling with. I generally don't swear in code that's going live, or public at all.
Re: Ask HN: Do you swear in your code?
#10http://philip.greenspun.com/ancient-history/professionalism-...
...may be of interest. But that said, no, I don't. Furthermore, colleagues who frequently use profanity in their everyday speech strike me as rather disrespectful.