King of Useless Comments

by Nick Thursday, October 09, 2008 10:02 PM

There is a lot of debate among programmers about the proper way to comment your code.  One type of commenting that is sometimes more difficult, is how to comment code that is related to a bug fix.  We've all encountered the types of comments where the programmer states the obvious:

int i = 0;  // Initialize an integer to 0

But "bug fix comments" can sometimes really be longer than necessary.  Here is a typical example of what I'm talking about:

//######################################################
//#
//# Bug #: 1234
//# Date:  10/2/2006
//# Name:  John Smith
//#
//#######################################################
MethodCallAddedToFixBug();
//#######################################################

This type of commenting drives me nuts for a couple different reasons.  For one, it takes up a huge amount of screen space, which breaks up the flow of the rest of the function, and makes it hard to understand.  Can you imagine if a single method had 3 or 4 of these "bug fixes" in them?

Secondly, for all that space taken up on screen, what information did we get?  We got a name, a date, and a number.  What was the defect?  How did this method call actually fix the defect?  We don't know.  Now, if you feel the need to add a comment when you insert code to fix a bug (and I can be convinced pretty easily that there is value to doing that), why not this?

// JS 10/2/2006 - Added call to fix Bug 1234.  This method includs missing validation logic that was causing exception
MethodAddedToFixBug();
Was that so hard?

You Can Also Find Me On StackOverflow

by Nick Monday, October 06, 2008 10:28 AM

Like most of the engaged developer community, I have discovered StackOverflow, the marvelous creation of Jeff Atwood and Joel Spolsky.  You can see my profile here.  So far I like the site.  The purpose of the site is to be the anti-Experts Exchange.  We all know Experts Exchange, and we all hate it's existance with a vengence.  It's the ultimate Walled Garden, and it sucks in Google furiously, so that its hard to actually find the answer to a question.  StackOverflow looks to succeed with developers where Experts Exchange has frustrated us all greatly.

I've yet to ask a question on StackOverflow, but I have spent a little time answering some questions, and even earned myself some of the easy badges.  It's a nice little ego stroke.  And overall, I really like the site.  It it easy to use, uncomplicated, and rewards people nicely, and at the same time seems to get the best answers to float to the top.  But it's also my nature to criticize a bit, and so here are the things I don't like about StackOverflow so far:

No Way to Link Duplicate Questions:  StackOverflow is sort of like a big Forum from the 1990's, but with extra "social networking" and "web 2.0" juju sprinkled in.  What that really means is that the user habits of a forum are likely to emerge very quickly, but that the site itself is just easier to use.  Because really... web 2.0 really just translates to good usability... not necessarily good user habits.

Probably the largest problem faced by a Forum moderator is the need to post a big post at the top of the forum that is called "FAQ - Read this First Before Posting" which is then largely ignored by everyone who goes on the forum so they can re-ask the question that was already answered in the FAQ.  In fact, odds are pretty much guaranteed that someone has complained about this already in the StackOverflow feedback area, but I'm too lazy to find it.  And there in lies the problem.  Once someone finds it, it would be nice if there was easy web 2.0 juju to link those together.

You can't prevent people from submitting duplicate questions because people are inherently lazy.  They don't want to go to the trouble of actually searching before asking, and maybe that's ok.  But by the same token, if someone is active in the community, they will eventually notice the same questions popping up again and again that they have already answered.  It would be nice to give them the ability to link questions together, rather than simply copying the same answer again... or worse, not bothering to answer the question again, because that gets frustrating, and in the end it doesn't serve the person asking.

How Many Profiles Do I Need?  StackOverflow is still in beta, and they are requesting input into new features, and also help with bugs.  They also have a nice blog where you can read up on the latest news.  But you'll notice that those two sites use different engines to run them.  That means that if I want to fully participate in the StackOverflow community, I need to not only register with the main site (using OpenID - YEAH!) but also with UserVoice for their bug/feature too (which doesn't use OpenID).  And since their blog is not linked into main site either, if I leave a comment on a blog post it doesn't connect up with my main profile.  This seems very strange to me for a site that is encouraging feedback by giving you points for helping.  No points for commenting on the blog?  No points for giving feedback on the site itself through UserVoice?

I understand the desire to not re-invent the wheel for a feature that is not core to your site.  After all, they went about the task of creating a site for answering questions, not blogging or bug tracking.  But at the same time, it would have been nice if they could have at least picked 3rd party software that adhered to the same principles as their core site... one of which being ease of sign up (though OpenID).  I don't know of a bug/feature site that use OpenID off hand, but I do know that DasBlog now supports OpenID.

And really, how much different is a blog post from a question?  And how much different is a feature request from a function?  I would think that they could have fairly easily incorporated all those features together, and encouraged even more feedback.  As it is, I don't want to post on their feedback site because I don't want to have to re-register again.

I'm sure more will come to me as I use the site more, but those two things jumped out at me almost immediately.

About Me

Nick Schweitzer Nick Schweitzer
Wauwatosa, WI

Contact Me
I'm a Software Consultant in the Milwaukee area. Among various geeky pursuits, I'm also an amateur triathlete, and enjoy rock climbing. I also like to think I'm a political pundit. ... Full Bio

Community Involvement

Twitter

Archives

Flickr Photos

www.flickr.com
This is a Flickr badge showing public photos and videos from Nick_Schweitzer. Make your own badge here.

Standard Disclaimers

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2017 Nick Schweitzer