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: <8d5dsc$c27$1@nnrp1.deja.com> (raw)
In-Reply-To: 38F603FE.B0C3ED83@utech.net

In article <38F603FE.B0C3ED83@utech.net>,
  "Jeffrey D. Cherry" <jdcherry@utech.net> wrote:
> Ted Dennison wrote:

> Regarding Emacs ... I don't use Emacs so this behavior was a surprise

I guess there are still a few of you. :-)

I can definitely understand wanting to keep your own council on
formatting. But Emacs' is so close to "right" for me, that its really
easier just to use it. My main complaint is that occasionaly I don't
want the standard capitalization (eg: acronyms).

> 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

I draw the line at one. For single parameter subprograms, (or multiple
parameter subprgrams where all but one are left defaulted) there is no
possibility of confusion, so it is indeed clearer to not supply the
parameter names. The only other situation where I'd advocate leaving off
the names is when the parameters are commutative.

It might look a little prettier when you write it to just slam all the
parameters together with no names. But when the code isn't working, the
first thing a person debugging it is going to be forced to do is go back
to the spec to verfy that those unnamed parameters weren't confused.

> 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?


On the theory that speaking from practice is better than just blathering
about theory, I went to look to see what I've done in the past. What I
found is...I don't do that. I do this instead:

   Target(i)(j) := foobar (a, b, c);
In the highly unlikely event that the three parameters of foobar are
commutative. More likely something like:
   Target(i)(j) := foobar (foo      => a,
                           bar      => b,
                           foobrand => c
                          );

I think "foobrand" is the correct technical term for a parameter to a
"foo" function. :-)

The problem with multidimensional arrays is that you can't easily take a
vector out of them and pass that to a standard subprogram, like you can
with arrays of arrays. I almost always end up wanting to do that. Thus I
don't use multidimensional arrays.

--
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 [this message]
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                                   ` 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                             ` Robert Dewar
2000-04-21  0:00                               ` Ted Dennison
     [not found]                               ` <38FFd43e.70f1bb7d@telepath.com>
2000-04-21  0:00                                 ` Larry Kilgallen
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
2000-04-13  0:00   ` Riyaz Mansoor
2000-04-13  0:00     ` Ted Dennison
2000-04-13  0:00     ` David C. Hoos, Sr.
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