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: <8d4t07$o15$1@nnrp1.deja.com> (raw)
In-Reply-To: 38F5DF8C.1A01E5A4@utech.net

In article <38F5DF8C.1A01E5A4@utech.net>,
  "Jeffrey D. Cherry" <jdcherry@utech.net> wrote:
> Robert Dewar wrote:
> >
> > I find the extra ); on its own line offensive and unnatural,

> lines.  I also agree with the ");" looking silly when it's

> I like the following form for a subprogram declaration:
>
>     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.

> Notice the consistency in the assignment statement.  But is
> it more readable to write:
>
>    i := foobar (f) + n(2);
>
> This may give the reader a subtle indication that foobar is
> a function call while n is an array.  I am curious to hear
> what others think of this practice ... is it just silly to
> worry about or does it indeed improve the readability of
> an expression?

Interesting. I never really thought about my tendancies here before. I'm
one of those who *likes* the syntactic transparency between arrays and
functions (and I'm a working engineer who has to debug a lot of other
people's bad buggy code, not some "ivory tower acedemic", as had been
claimed).

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.

   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.

   So what's different about the other %10? Some are situations where
there is some calculation or complex subranging inside the parenthesis.
One theory for why I did this would be that I have been
semi-subconciously using extra whitespace to draw the eye to the
"important parts" of a line.

  Other occurances happen when the contents of the parenthesis are
another identifier-parenthesis pair. Again, it could be argued that this
keeps from drawing undue attention to the identifier on the outside of
the operation. However, I suppose it could also be argued that this is
just a panicked attempt to save enough space to fit it all on a line,
turned into idiom.

--
T.E.D.

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


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




  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 [this message]
2000-04-13  0:00         ` Ray Blaak
2000-04-13  0:00         ` Jeffrey D. Cherry
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                                   ` Ted Dennison
2000-04-24  0:00                                     ` Samuel T. Harris
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-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-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       ` Samuel T. Harris
2000-04-13  0:00       ` Paul Graham
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   ` Ted Dennison
2000-04-14  0:00     ` Marin D. Condic
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-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
2000-04-15  0:00   ` Robert Dewar
replies disabled

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