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: <8d4t07$o15$1@nnrp1.deja.com>#1/1 X-Deja-AN: 610721449 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> X-Http-Proxy: 1.0 x25.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 16:35:20 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 <38F5DF8C.1A01E5A4@utech.net>, "Jeffrey D. Cherry" 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.