Live data from Hacker News

Ask HN: Do you swear in your code?

news.ycombinator.com

71–80 of 82 posts

Re: Ask HN: Do you swear in your code?

#72
I have nothing against it, but I don't do it. The source code is not my blog; if I want to rant about something, I write an article about it.

Comments are for quick explanations of things that aren't obvious. Documentation is for explanation of the obvious. Blogs are for ranting.

Re: Ask HN: Do you swear in your code?

#74
post #10

http://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.

Disrespectful to?...

Re: Ask HN: Do you swear in your code?

#75

No. Aside from the fact it's unprofessional, it makes you look amateurish if the code ever ends up public. This happened with some YouTube code last year, if I remember correctly, and that is exactly what it made me think.

Better code than you will ever write was written by people who swear a ton. Strange how that is.

Re: Ask HN: Do you swear in your code?

#76
post #69

Earlier quoted context omitted.

True story: During a summer internship years ago, I used Foo and Bar as placeholders throughout a web page comp. My boss sat me down for a serious chat about professionalism. Turns out he had never heard of Foo and Bar. Prior to that conversation, I had never heard of FUBAR.

Yes, that's the source of the symbols. Some people like them, some think they're unprofessional, yada yada. But I've never once had someone try to interpret "foo" as profanity...

Possibly, though it seems somewhat more complex than that.

http://www.catb.org/~esr/jargon/html/F/foo.html

Re: Ask HN: Do you swear in your code?

#78
post #3

Swearing 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.

True story: During a summer internship years ago, I used Foo and Bar as placeholders throughout a web page comp. My boss sat me down for a serious chat about professionalism. Turns out he had never heard of Foo and Bar. Prior to that conversation, I had never heard of FUBAR.

I think that's where FOO and BAR come from.

Re: Ask HN: Do you swear in your code?

#80
In my experience, it's not "normal practice" but it's common enough. I don't like it, not because it's unprofessional as such but because it conflicts with the principle of removing everything extraneous. I think the best code is code that has been distilled to its clearest essence.

Edit: incidentally, profanity in code is not limited to comments. "White Like [name deleted]s Balls" is a variable name I saw once and have not yet had the good fortune to forget. I'll let you guys guess whether this was code distilled to its clearest essence. :)

Post reply on HN