From: "Samuel T. Harris" <samuel_t_harris@Raytheon.com>
Subject: Re: ada writing guide
Date: 2000/04/13
Date: 2000-04-13T00:00:00+00:00 [thread overview]
Message-ID: <38F63461.91EC3625@Raytheon.com> (raw)
In-Reply-To: 38F5DF8C.1A01E5A4@utech.net
"Jeffrey D. Cherry" wrote:
>
> Robert Dewar wrote:
> >
> > I find the extra ); on its own line offensive and unnatural,
> > just as clear, and much easier on the eye to write
> >
> > > procedure Foo
> > > (D : in out Data;
> > > C : in Data);
> >
> > 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.
>
> I quite agree that if a complete declaration can appear on one
> line, it should not be arbitrarily broken up into two or more
> lines. I also agree with the ");" looking silly when it's
> on a line by itself. The part about "in" mode for parameters
> (not quoted above, but in the original post) I would also
> agree with, especially with function parameters. Now
> here is where I stray ... just a bit.
>
> I like the following form for a subprogram declaration:
>
> procedure Foo(
> D : in out Data;
> C : in Data);
>
I prefer ...
procedure foo
(
d : in out data; -- some meaningful comment about d.
c : in data -- some meaningful comment about c.
);
procedure foo
(
d : in out data;
c : in data
)
is
[declarations]
begin
[statements]
end;
I find the extra white space around the parameter group
natural and appealing.
The comments about d and c in the subprogram specification
can naturally be about the contact (a la Eiffle) assumptions.
The comments about d and c in the subprogram body
can be about internal assumptions or design details.
--
Samuel T. Harris, Principal Engineer
Raytheon, Aerospace Engineering Services
"If you can make it, We can fake it!"
next prev 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 ` Samuel T. Harris [this message]
2000-04-13 0:00 ` Paul Graham
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 ` Ted Dennison
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 ` tmoran
2000-04-17 0:00 ` Marc A. Criley
2000-04-15 0:00 ` Robert Dewar
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