Method Comments

A method comment is a (typically large) comment at the beginning of a method, which describes the method's functionality, parameters, parameter types, and return types.

As with many things, method comments are often extremely helpful, but are also often mandated as CompulsoryComments and thus used in many circumstances where they're frankly unnecessary, such as:

 int print_employee( int employee_id )
 /*
  * NAME: print_employee
  * RETURNS: int value of success.  0 if successful, -1 if could
    not connect to database, -2 if employee information could not
    be fetched.
  * PARAMETERS:
  * * int employee_id -- The ID of the employee to be printed.
  */

In this case, it may be best to StripExcessiveComments.

See also CodeComments | MethodCommenting | ToNeedComments.


EditText of this page (last edited May 9, 2011) or FindPage with title or text search