From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b62b9163b26144cf X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Exit Loop_Statement Date: 2000/05/10 Message-ID: #1/1 X-Deja-AN: 621560755 Sender: bobduff@world.std.com (Robert A Duff) References: <8f7oep$khc$1@enyo.uwa.edu.au> <8fbe94$gvr$1@pyrite.mv.net> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 2000-05-10T00:00:00+00:00 List-Id: "Jeff Creem" 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; }