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: <8d4nar$h8g$1@nnrp1.deja.com>#1/1 X-Deja-AN: 610682766 References: <8d1rso$bir$2@bunyip.cc.uq.edu.au> <8d1vhj$hdr$1@nnrp1.deja.com> <8d2hig$7e6$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x35.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 14:58:45 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 <8d2hig$7e6$1@nnrp1.deja.com>, Robert Dewar wrote: > In article <8d1vhj$hdr$1@nnrp1.deja.com>, > Ted Dennison wrote: > > You forgot the procedure's name. ;-) I prefer: > > procedure Foo > > (D : in out Data; > > C : in Data > > ); > > I find the use of IN redundant since it is the default, but > this is a matter of taste, as usual the critical thing is to > be consistent. I especially find the use of IN annoying in > functions. I'm beginning to come to the same conclusion on functions. You *know* they all have to be "in", so why bother saying it? If anything, that just give maintainers a false sense that the mode is under their control. For procedures, I think if you explicitly specify one mode, you should explicitly specify them all. But as you say, consistency is the most important thing here. > I find the extra ); on its own line offensive and unnatural, > just as clear, and much easier on the eye to write > > C : in Data); ...which I find uglier. But I'm probably in the minority there. > In GNAT we prefer to put things on a single line: > > > procedure Foo (D : in out Data; C : Data); > > If they fit comfortably on one line, and use the form with > one line per parameter only if that is not the case. In most places I've worked that is preferred too, if it is only one (or no) parameter. Any more than that, and it ends up being a personal judgement call which IMHO gives too much leeway to sloppier coders. Also, a multiple parameter procedure seems to be much more likely to have an extra parameter or two added later. Its annoying to have to radicaly reformat 4 lines of code from one because you added one parameter. (sigh) I guess any "example" he gave was doomed to start a long thread. :-) -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.