News for hackers. Stuff that matters.
Re:Ask HN: Do you swear in your code? by Hates_ on Monday June 16, 2008 @11:10AM (#218673)
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.
Re:Ask HN: Do you swear in your code? by ken on Monday June 16, 2008 @12:28PM (#218755)
I've heard more than one hacker speak about either ignoring or redefining "professionalism" (whatever that means):

JWZ: "I wear my unprofessionalism as a badge of honor." <http://www.jwz.org/doc/easter-eggs.html>;

PG: "Maybe some aspects of professionalism are actually a net lose" <http://www.paulgraham.com/opensource.html>;

PG*: "the way that he thought about professionalism did not differ from the thinking of a Mary Kay cosmetics saleswoman: wear nice clothes, drive a clean car, and don't say anything that might offend anyone" <http://philip.greenspun.com/ancient-history/professionalism-...;

We speak and write profanity in other contexts, so why not code? It shows respect for future maintainers that we're honest about what truly sucks, instead of watering it down. Plus, we don't care if clients or investors see that we don't wear suits (or even shoes); similarly, they care about what the code does, not what it looks like.

Re:Ask HN: Do you swear in your code? by notauser on Monday June 16, 2008 @12:44PM (#218774)
One interesting compiler bug later and your comment could end up in an error message.

Anyway I would only swear when I'm at home with a beer in my hand, so I only put swearwords in my code when I'm working at home with a beer in my hand ;)

Re:Ask HN: Do you swear in your code? by midnightmonster on Monday June 16, 2008 @12:27PM (#218752)
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.
Re:Ask HN: Do you swear in your code? by ajross on Monday June 16, 2008 @05:22PM (#219133)
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? by tjr on Monday June 16, 2008 @07:37PM (#219232)
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? by helveticaman on Monday June 16, 2008 @10:24PM (#219327)
I think that's where FOO and BAR come from.
Re:Ask HN: Do you swear in your code? by tx on Monday June 16, 2008 @12:26PM (#218749)
We aren't building tractors, we're "painting" software and do whatever makes us feel more creative. In fact some really great hackers I knew were very passionate about their code and coding process in general. Once we had a dedicated Yellow Pages book to throw in a brick wall (literally). That was awesome.

BTW, didn't you notice how often good programmers curse in public?

I suspect we work in different industries.

Re:Ask HN: Do you swear in your code? by BrandonM on Monday June 16, 2008 @01:09PM (#218801)
You think people who build tractors don't swear? After my work in steel manufacturing, I would bet that there is some informal manual next to a machine that has at least one swear word in it.
Re:Ask HN: Do you swear in your code? by axod on Monday June 16, 2008 @12:21PM (#218744)
You work in a corporate environment don't you. You had to fill out a "comment request form" in triplicate just to post the above comment ;)

I'd say it depends. If you're working for bigco, swearing is probably not going to go down well with your boss, or co-workers. If you're working in a startup/open source project/on your own, then swearing can be good and useful IMHO.

If I swear in the comments of some code (Rare), I can instantly see that I've had some issues with that code, or something I'm interfacing to is idiotic and needs fixing etc.

Re:Ask HN: Do you swear in your code? by edw519 on Monday June 16, 2008 @01:41PM (#218832)
You work in a corporate environment don't you. You had to fill out a "comment request form" in triplicate just to post the above comment

You don't work in a corporate environment, do you?

If you're working for bigco, swearing is probably not going to go down well with your boss, or co-workers

Since few bigcos I've ever worked at ever do code reviews, how would they even know?

After spending many years in corporate environments, it's easy to spot those who haven't when they post comments about corporate environments.

Re:Ask HN: Do you swear in your code? by axod on Monday June 16, 2008 @02:11PM (#218889)
My last job was in a corporate cubedom for 4 years. Not a massive company, but a few 100s of employees. We held weekly code reviews at one point. Also bosses do have a habit of suddenly believing that if they help code the project might run quicker, so they ask for svn access etc, then break everything :)
Re:Ask HN: Do you swear in your code? by edw519 on Monday June 16, 2008 @02:14PM (#218899)
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?

Re:Ask HN: Do you swear in your code? by axod on Monday June 16, 2008 @02:59PM (#218966)
Now I can't work out if you're being sarcastic or not.
Re:Ask HN: Do you swear in your code? by edw519 on Monday June 16, 2008 @03:37PM (#219018)
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? by axod on Monday June 16, 2008 @04:22PM (#219077)
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? by baltoo on Monday June 16, 2008 @03:03PM (#218972)
I'm located in the northern parts of Europe so perhaps that explains it but I routinely and deliberately use foul language in technically oriented internal documents. The rationale being that it should be harder to copy'n'paste and edit it in an ad hoc sales doc than to ask me for a more specific technical explanation.
Re:Ask HN: Do you swear in your code? by Hates_ on Monday June 16, 2008 @01:04PM (#218795)
I think people have mis-understood my comment. I never said swearing was bad. Practically every word that comes out my mouth is a swear word. I just don't think swear words in code makes for "beautiful" work. I even have a go at developers for not putting full stops at the end of comments ;)

In addition, it's got nothing to do with working for a large corporation as I work for a small advertising software company with less then twenty employees.