It's time once again to give all those cool-but-too-small-to-make-a-full-post submissions a home ...


Nick was disappointed that, despite all of GetGlobalTime()'s robustness, it didn't actually provide a method to apply the path integral transformation ...

 

SQWORD GetGlobalTime( const TCHAR* Filename )
  {
    //return greenwich mean time as expressed in nanoseconds since the
    //creation of the universe.  time is expressed in meters, so
    //divide by the speed of light to obtain seconds.  assumes the
    //speed of light in a vacuum is constant.  the file specified by
    //Filename is assumed to be in your reference frame, otherwise you
    //must transform the result by the path integral of the minkowski
    //metric tensor in order to obtain the correct result.

    return Time;
  }

I'm guessing that the author behind this next snippet of code (from yet another open source database) exhausted his entire comments budget and found a creative way to compensate ...

 

synchronized (surelyReachableObjectsWhichHaveToBeMarkedAsSuch) {
  waitRecommended = 
    surelyReachableObjectsWhichShouldHaveBeenProcessedButWereLockContentedSize
      == surelyReachableObjectsWhichShouldHaveBeenProcessedButWereLockContented.size();

    surelyReachableObjectsWhichShouldHaveBeenProcessedButWereLockContentedSize = 
      surelyReachableObjectsWhichShouldHaveBeenProcessedButWereLockContented.size();

    while (!surelyReachableObjectsWhichShouldHaveBeenProcessedButWereLockContented.isEmpty()) 
    {
      surelyReachableObjectsWhichHaveToBeMarkedAsSuch.push(
        surelyReachableObjectsWhichShouldHaveBeenProcessedButWereLockContented.getFirst() );
    }
}

Of course, it's not just open source developers who have to struggle with comment budgets. Jack's counter parts in the Middle Tier group must have used their entire budget internally, resorting to having to create things like the longest class name ever ...

 

GetProfileCustomerEntityReceiverInformationReceiverAndProgrammingInformationLi
stAccessCardInformationProgrammingListProductDetails

Fortunately, as Sebastian Redl discovered, not all source code needs to be commented. The Mozilla developers have learned that they can simply use descriptive variable names instead ...

 

nsCOMPtr<nsIEventQueue> kungFuDeathGrip(this);

Ok, I realize I'm deviating from comments a bit, so before I go back, here's a function that Steve found while developing a plugin for a 3D Studio Max ...

 

MaybeAutoDelete();

Adrian Hunt was happy to see that at least one of his predecessors tried to fight back against the mess that their system was becoming ...

 

/*
 * __ HISTORY __
 *
 * ...
 * 
 * DATE        : 2003-04-22
 * AUTHOR      : Samir Nagheenanajar
 * DESCRIPTION :
 *    Changed hard coded paths. It is widely considered incorrect to hack a 
 *    file with ifdef to include new functionality to an existing class. It
 *    is more elegant -- nay, correct -- to decend from the class and add the
 *    new functionality to the new decendant. It's called Object Oriented
 *    Programming or OOP.
 * /

Jeremy Lew found this little comment in some C++ source file. Judging from the comment, the developer at least had an inkling of his questionable sanity ...

 

void sysDraw::close()
{
  // Is this necessary????
  // probably not but what the hell.
  // better safe than sorry
  if (!this) return;                 
  
  // ... snip ...
}

Although the contractor "P.N," was long gone, K.A. thought he'd be nice and answer the almost two-year old question left in a Perl script ...

 

###################################################################### 
##                                                                  ## 
## 11/27/2003 PN I don't understand it but the {$a <=> $b} sorts    ## 
##               in numerical order instead of string order?        ## 
##                                                                  ## 
## 06/28/2005 KA That's because <=> is the NUMERIC comparison       ## 
##               operator.  'cmp' is the STRING comparison op.      ## 
##                                                                  ## 
###################################################################### 

C.W. was diagnosing a problem with the UNIX network agent for Veritas Backup Exec and took a peek in the log files. Veritas coders apparently have no love for Windows NT4 ...

 

15925: Initializing Advertisement Sending Process
15925: gethostbyname returned 0x401635a4
15925: address of PRODBCKSERV1 is 15925: butt-head OS

And I suppose I'll wrap it up with this comment that Adam Lazur found at the top of just about every single in-house-developed Perl script. Note that the "#" is the comment character ...

 

#use strict;            #good perl
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!