comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: ada writing guide
Date: 2000/04/13
Date: 2000-04-13T00:00:00+00:00	[thread overview]
Message-ID: <8d4nar$h8g$1@nnrp1.deja.com> (raw)
In-Reply-To: 8d2hig$7e6$1@nnrp1.deja.com

In article <8d2hig$7e6$1@nnrp1.deja.com>,
  Robert Dewar <robert_dewar@my-deja.com> wrote:
> In article <8d1vhj$hdr$1@nnrp1.deja.com>,
>   Ted Dennison <dennison@telepath.com> wrote:
> > You forgot the procedure's name. ;-)  I prefer:
> >    procedure Foo
> >       (D : in out Data;
> >        C : in     Data
> >       );
>
> I find the use of IN redundant since it is the default, but
> this is a matter of taste, as usual the critical thing is to
> be consistent. I especially find the use of IN annoying in
> functions.

I'm beginning to come to the same conclusion on functions. You *know*
they all have to be "in", so why bother saying it? If anything, that
just give maintainers a false sense that the mode is under their
control.

For procedures, I think if you explicitly specify one mode, you should
explicitly specify them all. But  as you say, consistency is the most
important thing here.

> I find the extra ); on its own line offensive and unnatural,
> just as clear, and much easier on the eye to write
> >        C : in     Data);

...which I find uglier. But I'm probably in the minority there.

> In GNAT we prefer to put things on a single line:
>
> >    procedure Foo (D : in out Data; C : Data);
>
> If they fit comfortably on one line, and use the form with
> one line per parameter only if that is not the case.

In most places I've worked that is preferred too, if it is only one (or
no) parameter. Any more than that, and it ends up being a personal
judgement call which IMHO gives too much leeway to sloppier coders.
Also, a multiple parameter procedure seems to be much more likely to
have an extra parameter or two added later. Its annoying to have to
radicaly reformat 4 lines of code from one because you added one
parameter.

(sigh) I guess any "example" he gave was doomed to start a long thread.
:-)

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




  parent reply	other threads:[~2000-04-13  0:00 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-12  0:00 ada writing guide Riyaz Mansoor
2000-04-12  0:00 ` Ted Dennison
2000-04-12  0:00   ` Robert Dewar
2000-04-13  0:00     ` Jeffrey D. Cherry
2000-04-13  0:00       ` Ted Dennison
2000-04-13  0:00         ` Ray Blaak
2000-04-13  0:00         ` Jeffrey D. Cherry
2000-04-13  0:00           ` Robert A Duff
2000-04-13  0:00           ` Ted Dennison
2000-04-14  0:00             ` Pascal Obry
2000-04-14  0:00               ` Ted Dennison
2000-04-14  0:00                 ` Pascal Obry
2000-04-17  0:00                   ` Ted Dennison
2000-04-17  0:00                     ` Florian Weimer
2000-04-17  0:00                       ` Ted Dennison
2000-04-17  0:00                         ` Ted Dennison
2000-04-18  0:00                         ` Robert Dewar
2000-04-18  0:00                           ` Ted Dennison
2000-04-18  0:00                             ` Robert Dewar
2000-04-18  0:00                               ` Ted Dennison
2000-04-18  0:00                                 ` Brian Courtney
2000-04-19  0:00                                   ` Brian Courtney
2000-04-19  0:00                                   ` Florian Weimer
2000-04-19  0:00                                 ` Florian Weimer
2000-04-19  0:00                                   ` Robert Dewar
2000-04-20  0:00                                     ` Ted Dennison
2000-04-20  0:00                                       ` Florian Weimer
2000-04-20  0:00                                         ` Ted Dennison
2000-04-19  0:00                                   ` Ted Dennison
2000-04-24  0:00                                     ` Samuel T. Harris
2000-04-24  0:00                                   ` Samuel T. Harris
2000-04-24  0:00                                     ` Robert A Duff
2000-04-25  0:00                                     ` Robert Dewar
2000-04-27  0:00                                       ` Samuel T. Harris
2000-04-20  0:00                         ` Samuel T. Harris
2000-04-20  0:00                           ` Ted Dennison
2000-04-21  0:00                             ` Robert Dewar
2000-04-21  0:00                               ` Ted Dennison
     [not found]                               ` <38FFd43e.70f1bb7d@telepath.com>
2000-04-21  0:00                                 ` Larry Kilgallen
2000-04-21  0:00                             ` Robert Dewar
2000-04-24  0:00                             ` Samuel T. Harris
2000-04-24  0:00                               ` Robert A Duff
2000-04-27  0:00                                 ` Samuel T. Harris
2000-04-20  0:00                         ` Emmanuel Briot
2000-04-20  0:00                           ` Ted Dennison
2000-04-16  0:00           ` Simon Wright
2000-04-16  0:00             ` Robert Dewar
2000-04-15  0:00         ` Robert Dewar
2000-04-16  0:00           ` Simon Wright
2000-04-13  0:00       ` Samuel T. Harris
2000-04-13  0:00       ` Paul Graham
2000-04-13  0:00     ` Ted Dennison [this message]
2000-04-13  0:00   ` Riyaz Mansoor
2000-04-13  0:00     ` David C. Hoos, Sr.
2000-04-13  0:00     ` Ted Dennison
2000-04-12  0:00 ` Robert Dewar
2000-04-13  0:00   ` Riyaz Mansoor
2000-04-13  0:00     ` Jean-Marc Bourguet
2000-04-15  0:00     ` Robert Dewar
2000-04-14  0:00 ` Riyaz Mansoor
2000-04-14  0:00   ` Robert A Duff
2000-04-14  0:00   ` tmoran
2000-04-14  0:00     ` David C. Hoos, Sr.
2000-04-15  0:00       ` Robert Dewar
2000-04-15  0:00       ` tmoran
2000-04-17  0:00         ` Marc A. Criley
2000-04-17  0:00       ` Ted Dennison
2000-04-18  0:00         ` Geoff Bull
2000-04-14  0:00   ` Ted Dennison
2000-04-14  0:00     ` Marin D. Condic
2000-04-15  0:00   ` Robert Dewar
2000-04-15  0:00   ` Robert Dewar
2000-04-15  0:00     ` Marin D. Condic
2000-04-15  0:00       ` Ken Garlington
2000-04-27  0:00         ` gbull
2000-04-16  0:00       ` Ehud Lamm
replies disabled

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