From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,791530e499e6a7f9 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: ada writing guide Date: 2000/04/13 Message-ID: <8d5dsc$c27$1@nnrp1.deja.com>#1/1 X-Deja-AN: 610833494 References: <8d1rso$bir$2@bunyip.cc.uq.edu.au> <8d1vhj$hdr$1@nnrp1.deja.com> <8d2hig$7e6$1@nnrp1.deja.com> <38F5DF8C.1A01E5A4@utech.net> <8d4t07$o15$1@nnrp1.deja.com> <38F603FE.B0C3ED83@utech.net> X-Http-Proxy: 1.0 x36.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Thu Apr 13 21:23:42 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-04-13T00:00:00+00:00 List-Id: In article <38F603FE.B0C3ED83@utech.net>, "Jeffrey D. Cherry" 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.