comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: AWS Coding Styles (and about boring plain-linear text files in the end)
Date: Tue, 18 Jan 2011 13:03:23 -0800 (PST)
Date: 2011-01-18T13:03:23-08:00	[thread overview]
Message-ID: <352ea557-f9ea-4347-b59d-9159ca2ab075@22g2000prx.googlegroups.com> (raw)
In-Reply-To: 8739oqdjrj.fsf@mid.deneb.enyo.de

On Jan 18, 12:44 pm, Florian Weimer <f...@deneb.enyo.de> wrote:
> * Adam Beneschan:
>
> > Maybe that's what the style guide author intended.  If so, I think he
> > had it completely backward.  Look at the RM's descriptions of what the
> > subprograms in language-defined packages do, and then try to figure
> > out how to describe them without referring to parameter names.  Try
> > Ada.Strings.Unbounded.To_String and To_Unbounded_String, for example,
> > in A.4.5(78-79).  That's just the first thing I went to when I picked
> > an Annex A section more or less arbitrarily---I didn't have to hunt
> > for the "best example".  Anyway, you *could* rewrite the description
> > in a way that doesn't refer to the parameter names, but all you gain
> > is verbosity and stilted-sounding language---at the expense of
> > clarity, readability, and several dozen of your readers' brain cells.
>
> Huh?
>
> In my version, I've got:
>
> | 9
> |         function To_Unbounded_String (Source : in String)
> |            return Unbounded_String;
> | 11
> |         function To_String (Source : in Unbounded_String) return String;
>
> | 78
> |    * If S is a String, then To_String(To_Unbounded_String(S)) = S.
> |
> | 79
> |    * If U is an Unbounded_String, then
> |      To_Unbounded_String(To_String(U)) = U.
> |
>
> So this description does not use the formal parameter names at all!

Son of a (*&#$(*&, I found the one section of A.4.5 that used names
other than the formal parameter names.  [Note that it doesn't try to
use English text instead of the formal names, but rather substitutes
its own algebra-like variable name.]

OK, then, look at most of the rest of A.4.5, or A.16, or A.10.5 other
than the File parameter.

But I'll take back one thing I said---the RM isn't as consistent as I
thought.  11.4.1 seems to avoid using formal parameter names.  In 3.9,
it looks as though the pre-Ada 2005 material tried to avoid using
formal parameter names, but subprogram descriptions added later did
not.

I'll stand by most of what I said, though.  Much or most of the RM
uses formal parameter names in the descriptions, and I believe that
avoiding formal parameter names gains nothing and often loses.

                                 -- Adam




  reply	other threads:[~2011-01-18 21:03 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17  5:07 AWS Coding Styles (and about boring plain-linear text files in the end) Yannick Duchêne (Hibou57)
2011-01-17  5:18 ` Yannick Duchêne (Hibou57)
2011-01-21  4:06   ` Yannick Duchêne (Hibou57)
2011-01-17  6:43 ` Shark8
2011-01-17 10:22   ` Yannick Duchêne (Hibou57)
2011-01-17 10:23 ` pascal.obry
2011-01-17 10:49   ` Simon Wright
2011-01-17 10:54     ` pascal.obry
2011-01-18 19:07   ` Florian Weimer
2011-01-18 19:47     ` Adam Beneschan
2011-01-18 20:44       ` Florian Weimer
2011-01-18 21:03         ` Adam Beneschan [this message]
2011-01-18 22:16       ` Yannick Duchêne (Hibou57)
2011-01-19  6:58         ` Simon Wright
2011-01-19  9:15           ` Yannick Duchêne (Hibou57)
2011-01-19 20:16             ` Simon Wright
2011-01-19 22:42               ` Peter C. Chapin
2011-01-19 22:21             ` Florian Weimer
2011-01-20  1:52             ` Stephen Leake
2011-01-18 20:23     ` Pascal Obry
2011-01-18 21:39       ` Georg Bauhaus
2011-01-18 22:13         ` Randy Brukardt
2011-01-19  0:47           ` Georg Bauhaus
2011-01-19  1:06             ` Yannick Duchêne (Hibou57)
2011-01-19  7:00               ` J-P. Rosen
2011-01-19  8:53                 ` Yannick Duchêne (Hibou57)
2011-01-19 10:04               ` Georg Bauhaus
2011-01-19 11:42                 ` Yannick Duchêne (Hibou57)
2011-01-19 13:17                   ` Georg Bauhaus
2011-01-19 21:56                     ` Yannick Duchêne (Hibou57)
2011-01-19 23:34                       ` Georg Bauhaus
2011-03-16 18:28                     ` Yannick Duchêne (Hibou57)
2011-03-16 20:13                       ` Shark8
2011-03-16 21:51                       ` Randy Brukardt
2011-03-16 22:01                         ` Yannick Duchêne (Hibou57)
2011-03-19  1:47                           ` Randy Brukardt
2011-03-16 19:59                     ` Yannick Duchêne (Hibou57)
2011-01-18 22:20       ` Yannick Duchêne (Hibou57)
2011-01-18 22:11     ` Yannick Duchêne (Hibou57)
2011-05-25 20:43   ` Yannick Duchêne (Hibou57)
2011-01-17 13:47 ` Bill Findlay
2011-01-17 14:02   ` Yannick Duchêne (Hibou57)
2011-01-17 21:12   ` Simon Wright
2011-01-18  8:03     ` Stephen Leake
2011-01-18 20:41       ` Simon Wright
2011-01-18  0:45   ` Adam Beneschan
2011-01-18  1:40     ` Bill Findlay
2011-01-19 11:12       ` Stephen Leake
2011-01-18  6:07     ` Yannick Duchêne (Hibou57)
2011-01-18  6:07     ` Yannick Duchêne (Hibou57)
2011-01-18  8:04     ` Stephen Leake
2011-01-18  9:11       ` pascal.obry
2011-01-19 11:17         ` Stephen Leake
2011-01-19 11:53           ` Yannick Duchêne (Hibou57)
2011-01-18  8:22     ` Dmitry A. Kazakov
2011-01-18  8:50     ` Georg Bauhaus
2011-01-18 14:20       ` sjw
2011-01-18 15:41         ` Adam Beneschan
2011-01-18  0:58 ` Adam Beneschan
2011-01-18  1:43   ` Bill Findlay
2011-01-18  6:10   ` Yannick Duchêne (Hibou57)
2011-01-18  7:02   ` Pascal Obry
2011-01-18  7:14     ` Thomas Løcke
2011-01-18  7:26     ` Yannick Duchêne (Hibou57)
2011-01-18 12:42     ` Peter C. Chapin
2011-01-18 21:09       ` Yannick Duchêne (Hibou57)
2011-01-18 22:01         ` Randy Brukardt
2011-01-18 22:35           ` Yannick Duchêne (Hibou57)
2011-01-18 23:37           ` tmoran
2011-01-20  2:14             ` Randy Brukardt
2011-01-18  8:06   ` Stephen Leake
2011-01-18  8:54     ` Georg Bauhaus
2011-01-18 15:45       ` Adam Beneschan
2011-01-18 22:03         ` Yannick Duchêne (Hibou57)
2011-01-19  7:19           ` J-P. Rosen
2011-01-19  9:07             ` Yannick Duchêne (Hibou57)
2011-01-19 13:31               ` J-P. Rosen
2011-01-20  1:53                 ` Stephen Leake
2011-01-19  9:13             ` Dmitry A. Kazakov
2011-01-19  9:28               ` Yannick Duchêne (Hibou57)
2011-01-19 10:04                 ` Dmitry A. Kazakov
2011-01-19 12:16                   ` Yannick Duchêne (Hibou57)
2011-01-24  5:13                   ` Yannick Duchêne (Hibou57)
2011-01-24  8:29                     ` Yannick Duchêne (Hibou57)
2011-01-19 13:39               ` J-P. Rosen
2011-01-19 14:20                 ` Dmitry A. Kazakov
2011-01-19 14:52                   ` J-P. Rosen
2011-01-19 15:25                     ` Dmitry A. Kazakov
2011-01-19 21:43                     ` Yannick Duchêne (Hibou57)
2011-01-19 22:20                       ` Dmitry A. Kazakov
2011-01-19 21:47                 ` Yannick Duchêne (Hibou57)
2011-01-21 19:17                   ` Robert Matthews
2011-01-21 19:54                     ` Yannick Duchêne (Hibou57)
2011-01-19 18:02             ` Jeffrey Carter
2011-01-19 11:21           ` Stephen Leake
2011-01-19 13:32             ` Yannick Duchêne (Hibou57)
replies disabled

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