comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: basic ada question
Date: 20 Aug 2005 10:28:29 -0400
Date: 2005-08-20T10:28:29-04:00	[thread overview]
Message-ID: <wcc3bp43coi.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: mtxNe.9344$RS.5707@newsread3.news.pas.earthlink.net

"Jeffrey R. Carter" <spam@spam.com> writes:

> Adrian Knoth wrote:
> 
> > It is a named parameter. You can use it to rearrange the order
> > of your parameters when calling a function/procedure.
> 
> It's more about clarity than order.

I strongly agree.  Being "creative" with the order of parameters makes
the code harder to read.  Uniformity is good.  I always use the same
order in all calls -- same order as the formals are declared -- even
when using named notation.  At least, I try -- I wish the compiler would
help me out by enforcing that.  (Or give me a tool that fixes it.)

>... Something like
> 
> Insert (Into => Name_List, Item => Current.Name);
> 
> is usually clearer than
> 
> Insert (Name_List, Current.Name);

Yes.  I'm a big fan of named notation.

Another advantage is when you have two parameters of the same type.
You can't accidently switch them if you used named notation.

I think you should choose formal parameter names that read nicely in
named-notation calls (even if they cause the body of the procedure to be
slightly less readable).

- Bob



  reply	other threads:[~2005-08-20 14:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-19 16:35 basic ada question Randy
2005-08-19 17:55 ` Adrian Knoth
2005-08-19 20:22   ` Simon Wright
2005-08-19 21:13     ` Adrian Knoth
2005-08-22 13:28     ` Marc A. Criley
2005-08-19 21:43   ` Randy
2005-08-19 22:03     ` Adrian Knoth
2005-08-20  3:30   ` Jeffrey R. Carter
2005-08-20 14:28     ` Robert A Duff [this message]
2005-08-21 17:37     ` Steve
2005-08-21 21:45       ` Randy
2005-08-22 13:41         ` Steve
2005-08-23  1:47           ` Steve
2005-08-23 17:24             ` Martin Krischik
2005-08-23 21:32               ` Adrian Knoth
2005-08-24 16:41                 ` Martin Krischik
2005-08-20  6:36   ` [OT] Randy
2005-08-20 12:58     ` [OT] Larry Kilgallen
2005-08-20 19:48       ` [OT] Randy
2005-08-20 20:25         ` [OT] Adrian Knoth
2005-08-20 21:55           ` [OT] Way out in Left field Randy
2005-08-20 22:44           ` [OT] Randy
2005-08-20 21:27     ` [OT] TEST Randy
2005-08-20 22:52       ` Frank J. Lhota
2005-08-20 23:00         ` Randy
2005-08-20 22:31 ` [ot] test Randy
2005-08-20 22:39 ` Randy
replies disabled

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