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,e94a7e4f6f888766 X-Google-Attributes: gid103376,public From: "M." Subject: Re: Comments (was: Self-referential types) Date: 1999/10/23 Message-ID: #1/1 X-Deja-AN: 539532547 References: <7ttb4a$8mq$1@nnrp1.deja.com> <3802f2db_2@news1.prserv.net> <3803B5E3.F96A6DD4@mitre.org> <3803c8bc_2@news1.prserv.net> <3804E7E0.6A0265FB@mitre.org> <38077EB3.E6911567@mitre.org> <380CA5AC.82499FE2@ftw.rsc.raytheon.com> <7um9ji$dor$1@nnrp1.deja.com> <380F2BA5.1EEE15F1@ftw.rsc.raytheon.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: abuse@tds.net (TDS.NET help Desk 1-888-815-5992) X-Trace: ratbert.tds.net 940656247 207.1.20.193 (Sat, 23 Oct 1999 00:24:07 CDT) Organization: TDS.NET Internet Services www.tds.net NNTP-Posting-Date: Sat, 23 Oct 1999 00:24:07 CDT Newsgroups: comp.lang.ada Date: 1999-10-23T00:00:00+00:00 List-Id: Wes Groleau wrote in message <380F2BA5.1EEE15F1@ftw.rsc.raytheon.com>... >My own view is comments like the following are worse than >unnecessary, they are pure clutter: > > -- check whether the current transaction is completed > if Is_Completed (Current_Transaction) then > > -- if so, close the source and destination DB files > DB_IO.Close (Source); > DB_IO.Close (Destination); These are rather benign examples of what I call "duh" comments. In other cases, the names are not so descriptive, and the comments refer to these names, making them especially useless. e.g.: -- Add 2 to st st := st + 2; -- Flibber the Gibbet Flibber(Gibbet); Such comments can arise when the programmer writes the comments first, then the code. This is a good practice IF the programmer uses it to establish the semantic requirements of the code, so that it will be easier to write (and maintain) code that implements them. "Duh" comments defeat this purpose by blurring the distinction between semantic requirements and implementation. M.