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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e61c8636ef35379d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-16 18:42:02 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!fr.usenet-edu.net!usenet-edu.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Examples in Docs, was Re: Escape Sequences in Strings Date: Wed, 17 Jan 2001 02:25:37 GMT Organization: Deja.com Message-ID: <942vqr$sd0$1@nnrp1.deja.com> References: <93objj$guk$1@nnrp1.deja.com> <93q77h$rr6$1@nnrp1.deja.com> <940f9j$nj2$1@nnrp1.deja.com> <940n0u$tnf$1@nnrp1.deja.com> <942brr$b0t$1@nnrp1.deja.com> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Wed Jan 17 02:25:37 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x63.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:4078 Date: 2001-01-17T02:25:37+00:00 List-Id: In article <942brr$b0t$1@nnrp1.deja.com>, mark_lundquist@my-deja.com wrote: > Not a connection, an analogy. With respect to the function > of a program, comments are superfluous; with respect to the > language definition, examples are superfluous. I disagree strongly with this analogy. In the case of a language definition, examples indeed convey no information that cannot be derived from the definition proper (unless the definition is incomplete). Yes, they may be helpful in understanding, but they do not have any non-derivable information. With comments in a program, the situation is quite different. Yes, they do not provide any additional information with regard to what the program does at the implementation loevel, but *that is NOT the purpose of comments*. The purpose of comments is to explain what the code is doing at a higher level of abstraction, and much more importantly WHY it is doing it that way (and in some cases, very importantly why it is NOT doing it some other way). You cannot even derive the specification of a program from the implementation (since the code typically embodies an over-specification). You for SURE cannot derive the motivation and high level abstract design from the code. Indeed if you write comments that CAN be derived from the code, as in: a := a + 1; -- increment a then you have written a junk, completely useless comment. Indeed I would say that comments like this are what are analogous to examples in programming language definitions :-) Sent via Deja.com http://www.deja.com/