"No Comment..."
January 26, 2003
(Sent in by someone who understandably wishes to remain anonymous...)
At a recent Extreme Programming contract, we followed XP's advice that excessive code comments are a sign of code that needs to be refactored. So with this in mind, we trawled through the source looking for "danger signal" code comments.
As it turned out, management didn't want us to spend time refactoring the code, because there was too much else to be getting on with (in which case you could question whether it was a "real" XP project because we weren't following all the practices!) Anyway these are some of the scarier comments that we found:
// Manky type-safe union gig to make persistence easier
// don't like this - can we think of a better way?
// to support Sybase's confused approach to strings
// difficult to achieve - the class that couldn't be found is this one
// I know this looks silly but it makes it easier to ...
// yes it sucks .. but no choice.
// nothing we can do
// no point in continuing...
// deliberately not yet implemented
// now implemented - could be slow
// This is the best we can do
// Makes no sense
// don't run this test just before midnight
// we hope that this will be thrown
// not yet implemented/unsupported
// change to avoid silly java String.substring problem
// difficult to achieve - the class that couldn't be found is this one
// this is a bit pants... it might be better to maintain a hashmap
// baby don't worry, 'bout a thing.
// will never happen ;->
// not strictly right
// pray they never change the implementation of HashMap
// probably nicer to do this another way, but I didn't
// we don't care
Message Forum:
Post a new message
Message Index: Cracked me up! Daniel NOCHANCEOF_JUNKFROMHERE@hotmail.com
I feel your pain... disco das@dasmegabyte.org
"Kill the dog" Martin Brown martin.brown@macquarie.com.au
The Messages: Cracked me up! I'll be looking for comments like these in our team's project files next week!!! Daniel NOCHANCEOF_JUNKFROMHERE@hotmail.com Redmond, USA / Heart Of Hell Sat Feb 01 17:46:48 GMT 2003
I feel your pain... But remember, dumbass comments are usually the result of a lot of time wasted on some API function or algorithm that doesn't work the way it's supposed to (or one would INFER it was supposed to). A who person loses an hour or two fighting with some API's half-working function which is very important to what they're doing, but will never be used again, is inclined to warn those who would come after them not to waste the same time. Kind of like scratching an X in the inlet to a dead end in a hedge maze. "Don't go here. It may look inviting, but you're really better off taking the long way."
That said, there's no excuse for cutesy comments. I once caught demerits in school for an overly cutesy comment in my code...happened to refer to a redhead in the class who was smoking hot...I think she was flattered. disco das@dasmegabyte.org
Wed Apr 02 22:39:04 GMT 2003
"Kill the dog" Actual comment seen in some implantable cardiac defibrillator software from a now defunct company.
The comment actually has some meaning as the code was designed to induce fibrillation for dog trials to test the efficacy of the reversion. Martin Brown martin.brown@macquarie.com.au Sydney, Australia Fri May 02 03:23:18 GMT 2003
Post a new message
<< Back to Programming
|