comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Exit Loop_Statement
Date: 2000/05/10
Date: 2000-05-10T00:00:00+00:00	[thread overview]
Message-ID: <wccog6ejzwa.fsf@world.std.com> (raw)
In-Reply-To: 8fbe94$gvr$1@pyrite.mv.net

"Jeff Creem" <jcreem@atetola.mv.com> writes:

> Take a look at the following snippet of code..
> 
> >     I := 0; --Initialize i
> >     Nof := 0; --Initialize NOF
> 
> After reading the comments, is there anything that you now know that you did
> not know before you read the
> comments....Nope....

Well, I wouldn't expect to see comments like that in
professionally-written code, but I don't think it's so bad for a
beginner to write comments like that.  Somebody who doesn't know how to
program, and/or doesn't know the programming language they're using very
well, can benefit from comments that remind them of the language
semantics.  Once they learn the language well, they can easily
learn to write better comments.  It's easier than *not* commenting early
on, and then later learning to do so.

By the way, here's an example of the kind of comments you're complaining
about.  This comes from an ACATS test, which is testing the pragma
Import feature for interfacing Ada code and C code.  It's so bad that
I think the author of this code must have been doing it as a joke.
I mean, it's got one simple line of executable code, and several
paragraphs explaining in detail how it works!

/*
-- CD30051.C                                                            
--                                                                       
--                             Grant of Unlimited Rights
--
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687 and
--     F08630-91-C-0015, the U.S. Government obtained unlimited rights in the
--     software and documentation contained herein.  Unlimited rights are 
--     defined in DFAR 252.227-7013(a)(19).  By making this public release, 
--     the Government intends to confer upon all recipients unlimited rights
--     equal to those held by the Government.  These rights include rights to
--     use, duplicate, release or disclose the released technical data and
--     computer software in whole or in part, in any manner and for any purpose
--     whatsoever, and to have or permit others to do so.
--
--                                    DISCLAIMER
--
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED 
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE 
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--     PARTICULAR PURPOSE OF SAID MATERIAL.
--*
--                                                                       
-- FUNCTION NAME: _cd3005_1
--                                                                       
-- FUNCTION DESCRIPTION:                                                 
--      This C function returns the sum of its parameter and 1 through
--      the function name.  The parameter is unchanged.
--
-- INPUTS:
--      This function requires that one parameter, of type int, be passed 
--      to it.
--
-- PROCESSING:
--      The function will calculate the sum of its parameter and 1
--      and return this value as the function result through the function
--      name.
--
-- OUTPUTS:                        
--      The sum of the parameter and 1 is returned through function name. 
--                                                                       
-- CHANGE HISTORY:                                                       
--      12 Oct 95   SAIC    Initial prerelease version.                  
--      14 Feb 97   PWB.CTA Created this file from code appearing in
--                          CD30005.A (as comments).
--!
*/
            int _cd30005_1( Value )
            {
                /* int Value */

               return Value + 1;
            }




      reply	other threads:[~2000-05-10  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-09  0:00 Exit Loop_Statement David Freshwater
2000-05-09  0:00 ` Ken Garlington
2000-05-09  0:00 ` Gautier
2000-05-09  0:00   ` Robert Dewar
2000-05-09  0:00 ` John English
2000-05-09  0:00   ` Robert Dewar
2000-05-09  0:00     ` John English
2000-05-09  0:00       ` John English
2000-05-09  0:00         ` Robert Dewar
2000-05-09  0:00     ` David Freshwater
2000-05-09  0:00       ` DuckE
2000-05-10  0:00 ` Jeff Creem
2000-05-10  0:00   ` Robert A Duff [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox