comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey D. Cherry" <jdcherry@utech.net>
Subject: Re: ada writing guide
Date: 2000/04/13
Date: 2000-04-13T00:00:00+00:00	[thread overview]
Message-ID: <38F603FE.B0C3ED83@utech.net> (raw)
In-Reply-To: 8d4t07$o15$1@nnrp1.deja.com

Ted Dennison wrote:
> >     procedure Foo(
> >        D : in out Data;
> >        C : in     Data);
> 
> I don't mind this so much. But there is a small problem with it. Emacs
> Ada mode (at least my version of it), will try to line up the parameters
> with the open paren, so unless you want to fight Emacs your whole life
> to put it back, you end up with:
> 
>    procedure Foo(
>                  D : in out Data;
>                  C : in     Data);
> 
> Which is really a smidge worse than:
>    procedure Foo (D : in out Data;
>                   C : in     Data);
> 
> ...which is what I was trying to get away from, due to the wasted
> horizontal space.
 
Oh I definitely agree with you here.  I like neither of the above two 
forms.  Since the indentation is based on the length of an identifier 
name, differing identifiers produce differing indentation.  I think this
practice produces an ugly jumble of code that is much more difficult
to read when compared to a consistent indentation.

Regarding Emacs ... I don't use Emacs so this behavior was a surprise for me.
I would guess that there must be a way to change this behavior within Emacs.
I don't often use the automated layout features of my editor since my fingers
already do their own automated layout. ;)

> Hmmm. It looks like what I do is the following:
>    Most functions have multiple parameters. In this case, named notation
> is used in a style similar to the one used for subprogram specs.
 
Would you agree that always using named notation makes the code longer and
less readable?  Or would you disagree?  Is there some optimal number of 
parameters to a subprogram that makes you use named notation rather than 
positional notation?  Or is there other criteria that makes you choose one
method over the other?

>    For the rest of the cases, about %90 of the time, there is a single
> space between the "(" and the identifier. This is true whether its an
> array, type conversion, or function call. So I do preserve
> reference transparency.

Cool.  How about another question that is related to array references versus
subprogram calls?  I've noticed that some people put space between consecutive 
parameters in a subprogram call, but never put a space between index components
in an array reference.  For example:

   Target(i,j) := foobar (a, b, c);

In this example, Target is a two dimensional array and foobar is a function 
that takes three parameters.  Should there be a space in the index expression
of the array component?  Your thoughts?

-- 
Regards,
Jeffrey D. Cherry
Senior IV&V Analyst
Logicon Space and Information Operations
Logicon Inc.
a Northrop Grumman company




  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 ` 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-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 [this message]
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                                   ` Florian Weimer
2000-04-19  0:00                                   ` Brian Courtney
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                         ` Emmanuel Briot
2000-04-20  0:00                           ` Ted Dennison
2000-04-20  0:00                         ` Samuel T. Harris
2000-04-20  0:00                           ` Ted Dennison
2000-04-21  0:00                             ` Robert Dewar
     [not found]                               ` <38FFd43e.70f1bb7d@telepath.com>
2000-04-21  0:00                                 ` Larry Kilgallen
2000-04-21  0:00                               ` Ted Dennison
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-13  0:00           ` Robert A Duff
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       ` Paul Graham
2000-04-13  0:00       ` Samuel T. Harris
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-14  0:00 ` Riyaz Mansoor
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-14  0:00   ` Robert A Duff
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