Follow Slashdot blog updates by subscribing to our blog RSS feed


Forgot your password?
Take advantage of Black Friday with 15% off sitewide with coupon code "BLACKFRIDAY" on Slashdot Deals (some exclusions apply)". ×

Submission + - Humor in code: unprofessional or not? 2

DrVomact writes: Do you ever inject humor into the comments of your code or—heaven forfend—into the code itself? I recently had a "code review" of a Perl automation program I had written for my department. The salient criticism that emerged was that there was "sarcasm" in my comments, and that this was unprofessional. In retrospect, it was not surprising that the criticisms concentrated on my comments, as no one else in this group does much programming (the PHB claims to have "been a coder" once upon a time...I think he wrote COBOL on punch cards); nevertheless I was dumbstruck. What kind of world is it where you aren't allowed the occasional funny comment in your code? Do we have to be serious all the time? I asked a programmer in the "R & D" group of this paleolithically conservative company I work for, and he responded with a complete unsolicited psychoanalysis: he advised that I should develop a "professional personality" that was different from my real one I use at home. I was shocked—nay, mystified: where do you learn how to do that?

But let's concentrate on the smaller, more manageable issue: is humor in comments truly verboten? Am I the only one who makes the occasional light remark, or even a self-deprecating reminder to "Change this, you idiot...what were you thinking"? I've resolved to take the humor issue to a jury of my peers: to wit, the esteemed denizens of Slashdot.

I received an annotated copy of my code from my PHB, pointing out all my lapses into "unprofessionalism." Here are a few of the lines from my program that were deemed "unprofessional", along with my comments, and meta comments). I cannot actually guarantee that there is any genuinely funny stuff here, only that my completely humorless PHB suspected that it might be tainted. (Sorry about the lack of indenting...couldn't figure out how to make Slashdot's subset of HTML do that.)

if ($^O eq 'MSWin32') {
use Win32::Console;
Win32::Console::Free( );

Weirdly, nobody thought this was at all funny or objectionable.

# Set the directory if we got lucky
This was in a set of nested conditional tests that tried to find a file, no matter what crazy place the person running the program had stuck it. I fail to see this as sarcasm...I call it "cheerful optimism".

# Fix nasty problem where...
Comment in code that fixes crazy stuff in input files. Apparently, the word "nasty" is nasty.

$sysreturn = $proc->wait; # This gets exit code of process (it's already gone, so it's not really going to wait)
The parenthetical comment was marked as objectionable. You got me; I thought this was a potentially confusing line of code, and that the comment helped.

} else { # For all others, we just need to recover the original declarations that got eaten by the XSLTs
The word "eaten" was deemed unprofessional, sarcastic, or something.

my $status = shift @_; # 1 means the error causes certain death, undef or 0 means it's a warning (user gets to try again), 2 means it's a "notification"
Describes possible values passed to an error handler; "certain death" was deemed objectionable. Perhaps it was construed as a threat?

my %args = @_; # Stuff arguments into a hash, so we can look them up one at a time
"stuff" is an offensive word, apparently. All instances of "stuff" were marked as offensive. Good thing I didn't use "slurp", or "suck", huh?

if($name ne "subsection") { # We want the minor stuff included with first subsect file
To my great consternation, "stuff" is objectionable both as a verb and a noun! I think maybe PHB was using search-and-replace for his code analysis, though.

$button_text="Bummer!"; # It's NOT OK, man!
This one caused the most outrage. It's actually part of the code, unlike the other cases—it's the text of a button in a fatal error dialog. I completely hate when an application notifies me of a fatal error and asks me to click a button labeled "OK"—as if asking for my approval for having screwed up. Like my comment's not OK. PHB wanted "OK", but I finally changed it to "Exit".

So, I ask you, my peers of Slashdot, to pass judgment on me: am I hopelessly unprofessional? Or have I discovered the real reason why so many programmers don't comment their code?

Journal Journal: Cost of Text Messaging

Apart from "because people will pay it", why do US cell providers charge so much for text messaging? Text messages place very little strain on the networks compared to voice calls, because of their small throughput and high latency. And yet, it is cheaper using most providers and plans to make a 5 minute call than to send a single text message.

User Journal

Journal Journal: Starting salary in computer science; is a Bachelor's enough?

I'm a computer science major who'll be graduating in May 2008. I was recently asked to interview for a consulting firm near Washington, DC, for a job that would start in the fall of 2008, assuming I get the required Top Secret security clearance. I think they're reasonably interested in me, and I'll be interviewing very soon. My question is: what kind of salary should I expect? This is a top-notch company, and I'm very qualified for the job. Maybe more importantly, I have a history of pi


Submission + - DirectX 10 - Are We There Yet? IQ and Performance (

MojoKid writes: "When DirectX 10 was first introduced to the market by graphics manufacturers and subsequently supported by Windows Vista, it was generally understood that adoption by game developers was going to be more of a slow migration than a quick flip of a switch. That said, nearly a year later, the question is how far have we come? This in-depth HotHardware article showcases many of the most popular DX10-capable game engines, like Bioshock, World In Conflict, Call of Juarez, Lost Planet, and Company of Heroes, and features current image quality comparisons versus DX9 modes with each. The article also details performance levels across many of the more popular graphics cards, from both the mid-range and high-end. Digest all the data and you be the judge. Are we there yet?"

Journal Journal: Open letter to the CRIA regarding demonoid

Recently I had been asked whether I thought downloading music was morally wrong. Altho I can express my opinion, it's very hard to put in a few paragraphs without adding tons and tons of hyperlinks.

Fortunately, I stumbled upon this letter (courtesy of torrentfreak), which makes a wonderful statement in favor of music downloading and why the recording industry is going down.

User Journal

Journal Journal: Trolls on /. get moderated 5, Insightful, Rant 9

I'm a Christian. I respect the opinions of rational non-Christians and am open to the fact that not every intelligent person will agree with me. I don't try to force my religion on people who don't want to hear about it. But I don't like it when people bash Christianity without cause on slashdot. Everyone (rightly) derides politicians for the "Muslims are terrorists" slur but it seems like open season on Christianity sometimes around here.


Submission + - My Afternoon in Wal-Mart's MP3 Download Hell ( 2

Lopy writes: "Everything about the process of buying DRM-free music from Wal-Mart is wrong. At one point they actually asked me to reveal my "baby's due date"! And that wasn't even the absurd part. I had to install support for Windows WMA protected music files just to download an MP3. The whole sad story is detailed on"

Philosophy: A route of many roads leading from nowhere to nothing. -- Ambrose Bierce