Live data from Hacker News

Ask HN: Do you swear in your code?

news.ycombinator.com

61–70 of 82 posts

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

#61
For those of you who swear in your code base, I ask you this: is it ok in your company to swear in a meeting? The code you write isn't just for you, it is for everyone on the team, including people you haven't met yet. Is that what you really want to communicate to others?

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

#62
post #59
post #50

Earlier quoted context omitted.

So you have worked in a corporate environment. My mistake. But tell me, when did you ever have to fill out a "comment request form" in triplicate?

Now I can't work out if you're being sarcastic or not.

Touche.

I've worked in many corporate environments, some where things were perfectly logical and others that aspired to be as good as Dilbert.

But I never had to fill out anything in triplicate. I guess I should have realized the sarcastic flag was up. Sorry.

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

#63
post #43

This is a line from our tag unit tests: @tag.name = "this is a really long tag name that exceeds the maximum length which is set at 65 characters, that should do it! no wait, we changed it to 128 so now it needs to be significantly longer so I guess I'll just throw some more text into here and maybe a gratuitous 'fuck' for the next time someone greps for the f-bomb"

I'd enjoy seeing that in a long file of otherwise stale code. I like creative/surreal comments as well, if they fit the code.

That said, a sloppy file full of f-bombs can be annoying and repetitive, too.

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

#64
I swear in code like I swear in life, only rarely and with great motivation. If I am going through code and see an "F bomb" I know I did something seriously wrong in that bit of code that I didn't have time to fix.

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

#65
post #62
post #59

Earlier quoted context omitted.

Now I can't work out if you're being sarcastic or not.

Touche. I've worked in many corporate environments, some where things were perfectly logical and others that aspired to be as good as Dilbert. But I never had to fill out anything in triplicate. I guess I should have realized the sarcastic flag was up. Sorry.

We had so much Sarbanes-Oxley bs anything seemed possible. "Oh you can't use an IM client that isn't approved by us, as it's against S-OX". (Approved by us meant that they paid some inferior crappy IM company to install their client on all company computers. Then they paid a fee per user) Nothing like corporate waste :)

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

#66
post #36

I used to ... until about 8 years ago when I response.write'd a large "FUCK YOU" in an asp app that I forgot to take out. A big honkin' "FUCK YOU" that showed up during QA 5 minutes before client showed up for review. Never again.

This is exactly why I don't put curse words in code, even in comments. This stuff really does happen, and the results can be awkward. It just isn't worth it.

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

#67

For those of you who swear in your code base, I ask you this: is it ok in your company to swear in a meeting? The code you write isn't just for you, it is for everyone on the team, including people you haven't met yet. Is that what you really want to communicate to others?

Yes, and yes. The last time I worked at a company where people didn't feel comfortable swearing in meetings was probably 1997. Honest and casual communication is faster, friendlier, and more enjoyable.

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

#69
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.

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

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

#70
I do swear in code occasionally. If the cheap laugh is enough to make me realize that I need to step away from the computer and think about what is making me want to swear at it (stopping me from writing desperation code that breaks stuff and will get deleted later), then it is worthwhile, I think.
Post reply on HN