Leaving dev comments in code

I have had my share of problems with development teams in the past because of this issue. I have had my clients report me “foul language” in error messages, inside code comments and so on. There is simply no excuse or even a logical reason to do this.

Off Topic:

The off-topic PHP discussion in this thread is split off to http://www.sitepoint.com/forums/php-34/code-comments-execution-time-740240.html

Back on the topic of cursing… I sometimes leave mild curses such as “damn” or “bloody” (which I consider a curse even most people don’t) in PHP comments. More often I grouse about what the previous programmer did wrong in the comments. As comments go I can be a Chatty Kathy as it where.

This said, a word of advice from the esteemed Mark Twain:

[INDENT]“Profanity, while lacking a certain eloquence, is unequaled in its ability to convey pain. If you don’t believe this strike your hand with a hammer.”[/INDENT]

So there is a time and place for it. Every other word whether written or spoken has no proper time or place except among the uneducated and the crude.

In comment texts if I type a curse and let it stand its because that section of the code was frustrating me and especially difficult to write in the first place. The curse therefore stands as a warning to the next guy that tampering with the code may cause them similar problems.

That goes hand in hand with George:

[I][INDENT]When asked by his nephew about his profanity, Patton remarked, “When I want my men to remember something important, to really make it stick, I give it to them double dirty. It may not sound nice to some bunch of little old ladies at an afternoon tea party, but it helps my soldiers to remember. You can’t run an army without profanity; and it has to be eloquent profanity. An army without profanity couldn’t fight it’s way out of a piss-soaked paper bag.”

“As for the types of comments I make”, he continued with a wry smile, “Sometimes I just, By God, get carried away with my own eloquence.”[/INDENT][/i]

… and it often seems to me that today we have WAY too many little old ladies thinking we’re dealing with afternoon tea parties and not business. Even funnier when it comes from your metro-sexual dirty hippies who need to go back to singing Lesbian Seagull around the drum circle who get their panties in a twist over daring to say something negative about… ANYTHING.

But as I learned at an early age, “if you can’t say anything nice” is a cop-out by limp wristed “me too” wussies who want to stamp out anything resembling progress or improvement… Basically the types who are doomed to be employees their entire lives. Ding, fries ready. Back-slapping hug fests with rose coloured glasses do NOT do anything but harm – anyone who tells you otherwise is selling something.

Or as George said, “If everyone is thinking the same, somebody isn’t thinking.”

Commenting code is very useful, but commenting code with foul language isn’t. Its not professional either and if I did that when I worked at an agency I’d expect to get a ticking off about it. You never know who will see it - the client, visitors to the site etc.

Which is the thing – those are the two you NEVER want to see that in the PRODUCT… There’s around the office banter, and then there’s the PRODUCT.

… and you never know who’s going to end up using the product and coming across your… embarrassing easter egg.

Fun how I’m on both sides of the fence on this one.