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 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: "Jeffrey D. Cherry" Subject: Re: ada writing guide Date: 2000/04/13 Message-ID: <38F603FE.B0C3ED83@utech.net>#1/1 X-Deja-AN: 610750471 Content-Transfer-Encoding: 7bit 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> X-Accept-Language: en,pdf Content-Type: text/plain; charset=us-ascii X-Trace: azure.impulse.net 955647014 192 207.154.67.59 Organization: Logicon MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-04-13T00:00:00+00:00 List-Id: 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