Source Comment-o'-the-Day
Tuesday, January 31, 2006
Non-coders can safely ignore this one. I just needed to document it. Pun not intended, but enjoyed and allowed to remain.

I'm plowing through a client's large PHP script to convert the output from HTML to PDF. The formatting is generally awful, with indentation all over the place and unneccessary code tossed about like an excited Shriner firing candy at a parade crowd. Sure, it's fun to watch, but you won't ever watch anything again if a piece hits you in the eye.

I digress.

Source code is the human-readable language that programmer's write that in-turn becomes a piece of software through various means. Good programmers will add comments to their source when it is unclear why they are doing something or even what they're doing at all.

Today I ran across the following helpful source comment:

//store a character in a variable.

This is similar to a movie review going this way:

//there was an actor in a plot.

Alright, back to work.


Blogger Jessica said...

While we're at it, why not name a function "DoSomething()"?

2/01/2006 11:17 PM  
Blogger Clint said...

Unmaintainable code is one thing... that can easily be attributed to laziness in most cases.

Ridiculously general commenting, on the other hand, is mind-boggling.

In the same script, the coder decided to give a brief explanation of an array, and remind the future code-maintainer that arrays start with 0, and not 1, in PHP.

2/02/2006 12:27 AM  
Blogger the mom said...

i've known some programmers that need those "reminders".

2/02/2006 10:46 AM  
Blogger enderC said...

// post a link to

2/02/2006 1:14 PM  
Blogger Clint said...

My example isn't nearly as good as thedailywtf's, but it is mine, so I cherish it.

2/02/2006 1:19 PM  
Blogger Balloon Pirate said...

hey computer guy! howzcome the ads all go spazzy on when I use firefox?


2/15/2006 1:21 PM  
Blogger Clint said...

Well, I checked out MSNBC in Firefox 1.5 and didn't notice any spazziness, but this would be my guess:

The MSNBC web-dudes designed the site and did thorough testing in all variations of Internet Explorer. Then someone said, "Hey, this looks a little weird in Mozilla/Firefox".

Then the Microsoft project manager gave a coyish grin and said, "Oops!" while all of them had a good chuckle.

All seriousness aside, IE's rendering engine is so standard-uncompliant it's painful. And since 90% of us use IE, most websites are written incorrectly because IE doesn't mind.

2/15/2006 1:26 PM  

Post a Comment

<< Home