comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Examples in Docs, was Re: Escape Sequences in Strings
Date: Tue, 16 Jan 2001 05:42:54 GMT
Date: 2001-01-16T05:42:54+00:00	[thread overview]
Message-ID: <940n0u$tnf$1@nnrp1.deja.com> (raw)
In-Reply-To: 940f9j$nj2$1@nnrp1.deja.com

In article <940f9j$nj2$1@nnrp1.deja.com>,
  peter_richtmyer@my-deja.com wrote:
> Robert Dewar said:
>
> > Note: for my own taste, I hate to present-by-
> > example, and I hate examples, but my experience is most
> > people like examples.
> > For instance, most people want MORE examples in
> the RM, I
> > regard them as irritating redundant (well
> hopefully redundant)
> > non-normative junk :-)
>
> This statement surprised me a little at first.

Be careful to note that I was just expressing my
own personal viewpoint. As I said, and as I say
in what is quoted above, I quite understand that
most people *do* like examples, and indeed many
people find it very difficult to read language
rules without examples. So I am all in favor of
providing examples, and you will see loads of
examples in the GNAT documentation (particularly
in the specs of the GNAT.xxx library).

Note however, that there is a danger which is
to let examples take the place of thorough
rules. Some people seem to think they can
replace full semantic descriptions by examples,
and *that* is surely a mistake.

> I have saved a comment of yours where you said
> that you *liked* to document code, and encourage
> others to do so. You said that, if you do it
> enough, you can get to enjoy it (or words to that
> effect.) Putting examples in documents is
> somewhat similar to putting comments in code. It
> is not necessary, but it sure makes it easier for
> the readers.

I am not sure there is really any specific connection
between examples in documents and comments in code.
Comments in code are descriptions of what the code
does and why and how it does it. Examples may be
often be useful in this connection if some obscure
piece of code in GNAT for instance is to handle some
particular obscure use of the language, it is often
helpful to readers to provide examples.

Going back to my original comment, I again stress that
I perfectly well understand that my taste is not typical
here. I doubt there are many people who learned COBOL
from the ANSI standard (as I did :-)

> But then, I have written documents that I thought
> were pretty clear, only to find that others
> needed examples to understand them.

Yes, as I say, many people *do* need examples. However,
there is a danger that there understanding is limited to
the examples, and is not comprehensive. Actually there are
few programmers who really thoroughly know the semantics
of the language they are using.

> But code and
> documents should be written for the reader.
> (Yes, I know that that is not an original thought
> on my part). :-)

The right way to look at comments in code is to
think of it as a text book, and yes, of course
comments are written for the user. If something
is not clear in the code, there is a bug in the
comments and it needs to be fixed, and it is the
reader not the writer who is the arbiter of what
is clear.

We always encourage new people coming into the
GNAT project to make comments on what was NOT
clear to them in the code, since they have a
fresh eye and a more useful perspective in some
respects.

I don't think we really disagree on anything
here (though we may have personally different
tastes with respect to language definitions :-)


Sent via Deja.com
http://www.deja.com/



  reply	other threads:[~2001-01-16  5:42 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-15  0:00 Escape Sequences in Strings Jean Cohen
2000-11-15  0:00 ` John English
2000-11-15  0:00   ` Robert Dewar
2000-11-15  0:00     ` Ehud Lamm
2000-11-16  0:00       ` John English
2000-11-16  0:00         ` Marin David Condic
2000-11-16  0:00         ` Tarjei T. Jensen
2000-11-16  0:00           ` Ken Garlington
2000-11-16  0:00             ` Keith Thompson
2000-11-16  0:00             ` Marin David Condic
2000-11-15  0:00 ` Preben Randhol
2000-11-15  0:00 ` Marin David Condic
2000-11-16  0:00   ` Ada Streams usage (was Escape Sequences in Strings) Marc A. Criley
2000-11-16  0:00     ` Marin David Condic
2000-11-16  0:00       ` Ted Dennison
2000-11-16  0:00         ` Marin David Condic
2000-11-16  0:00           ` Ted Dennison
2000-11-16  0:00             ` Marin David Condic
     [not found]     ` <igh81t8b3hdrsc167do6qr0h1joa73c1jr@borpin.co.uk>
2000-11-18  0:00       ` Marin David Condic
2000-11-18  0:00         ` David Kristola
2000-11-19  0:00           ` Marin David Condic
2000-11-19  0:00             ` Marin David Condic
2000-11-20  0:00               ` Brian Orpin
2000-11-20  0:00                 ` Marin David Condic
2000-11-19  0:00         ` Ted Dennison
2000-11-19  0:00           ` Marin David Condic
2000-11-19  0:00             ` Robert Dewar
2000-11-20  0:00               ` Randy Brukardt
2000-11-21  0:00                 ` Ted Dennison
2000-11-21  0:00                   ` Randy Brukardt
2000-11-21  1:31                 ` Robert Dewar
2000-11-21  1:33                 ` Robert Dewar
2000-11-21  0:00                   ` Randy Brukardt
2000-11-22  5:00                     ` Robert Dewar
2000-11-20  0:00               ` Marin David Condic
2000-11-21  0:00                 ` Robert Dewar
2000-11-19  0:00             ` Ted Dennison
2000-11-19  0:00               ` Robert Dewar
2001-01-12 13:18 ` Escape Sequences in Strings Andrew Hately
2001-01-12 20:03   ` Keith Thompson
2001-01-18  8:29     ` Lao Xiao Hai
2001-01-18 15:22       ` Robert Dewar
2001-01-18 22:43         ` Randy Brukardt
2001-01-21 11:54         ` Dale Stanbrough
2001-01-21 22:35           ` directly accessing DOS screen memory (was: Re: Escape Sequences in Strings) Jeffrey Carter
2001-01-12 19:37 ` Escape Sequences in Strings tmoran
2001-01-13  1:38   ` Robert Dewar
2001-01-13  6:48     ` tmoran
2001-01-13 18:36       ` Robert Dewar
2001-01-16  3:30         ` Examples in Docs, was " peter_richtmyer
2001-01-16  5:42           ` Robert Dewar [this message]
2001-01-16 20:44             ` mark_lundquist
2001-01-16 22:43               ` Larry Kilgallen
2001-01-17 15:06                 ` mark_lundquist
2001-01-17  2:25               ` Robert Dewar
2001-01-17 15:28                 ` mark_lundquist
2001-01-17 16:20                 ` Brian Rogoff
2001-01-17 18:04                   ` Wayne Lydecker
2001-01-17 19:23                     ` BSCrawford
2001-01-18  0:15                       ` Jerry Petrey
2001-01-19  0:01                     ` tmoran
2001-01-18  3:44                   ` Robert Dewar
2001-01-18 16:45                     ` Brian Rogoff
2001-01-18 19:53                       ` Robert Dewar
2001-01-18 22:58                         ` Georg Bauhaus
2001-01-19 16:40                           ` Robert Dewar
2001-01-19  7:49                         ` Learning methods Anders Wirzenius
2001-01-19 18:57                         ` Examples in Docs, was Re: Escape Sequences in Strings mark_lundquist
2001-01-21 12:05                         ` Dale Stanbrough
2001-01-21 15:35                           ` Robert Dewar
2001-01-17 22:10                 ` Matthew Woodcraft
2001-01-18  3:52                   ` Robert Dewar
2001-01-16 16:06           ` Examples in Docs Robert C. Leif, Ph.D.
2001-01-16 21:29             ` mark_lundquist
2001-01-18  0:50               ` Randy Brukardt
2001-01-18 16:46                 ` mark_lundquist
2001-01-18 17:24               ` J. David Bryan
2001-01-17  2:43             ` Robert Dewar
2001-01-17 21:17               ` Robert C. Leif, Ph.D.
2001-01-16 20:01           ` Examples in Docs, was Re: Escape Sequences in Strings mark_lundquist
2001-01-17 10:59             ` Peter Richtmyer
2001-01-19 18:55               ` mark_lundquist
2001-01-20 14:24                 ` Robert Dewar
2001-01-20 14:36                   ` Preben Randhol
2001-01-20 15:00                     ` Robert Dewar
2001-01-21 11:24                       ` Preben Randhol
2001-01-22 14:47                         ` Ted Dennison
2001-01-22 20:08                           ` Preben Randhol
2001-01-22 20:14                             ` Preben Randhol
2001-01-20 19:02                   ` Stephen Leake
2001-01-20 19:50                     ` Georg Bauhaus
2001-01-21 11:35                     ` Preben Randhol
2001-01-22 23:58                   ` Mark Lundquist
2001-01-27  1:43                   ` Increasing the readability of Ada was RE: Examples in Docs Robert C. Leif, Ph.D.
replies disabled

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