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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e9f0eae6d714d11c X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Re: Gnat pretty printing Date: 1998/12/15 Message-ID: <36768133.C85363F1@pwfl.com>#1/1 X-Deja-AN: 422523182 Content-Transfer-Encoding: 7bit Sender: condicma@bogon.pwfl.com References: <74lt16$9r0@romeo.logica.co.uk> <366E9E44.AA7370C7@pwfl.com> <74on70$m9o$1@cnn.Princeton.EDU> <36714049.2C5CE298@pwfl.com> Content-Type: text/plain; charset=us-ascii Organization: Pratt & Whitney Mime-Version: 1.0 Reply-To: diespammer@pwfl.com Newsgroups: comp.lang.ada Date: 1998-12-15T00:00:00+00:00 List-Id: Robert A Duff wrote: > > Marin David Condic writes: > > > procedure Pop ( > > Item : out Element_Ptr_Type ; > > List : in out List_Type) is > > -- > > Temp : Link_Type := null ; > > Why do you like the colon after Temp to line up with the colons in the > parameter list? Temp is local, and has nothing to do with the > parameters, so why make it look similar? And why should the ":= null" > line up with the "is"? > > > And why do all these ":=" line up? > > > What's the purpose of the extra space there? > > > Why two lines for the Dispose? > > > And why extra space there? And why ";" on the next line? > Maybe that's just an accident of posting software. > I suppose there's no easier way to start a religious debate than to say "I like this formatting style..." :-) Why? Why does everything line up? Well, I use the tab key a lot and for some reason it fits my obsessive-compulsive personality to see everything line up. I just find it graphically attractive to see all the formals on one side of a line and actuals on the other, or object names on one side of the line, types on the other, etc. And if you look at the code as I format it, you'll see that it is very regular - things are done the same way every time. Parameter associations are always named, the fingers (=>) all line up, etc. etc. I suppose when you get down to it, I can't give you some kind of rational, technical "why" answer to this. It's a style I evolved over a long period of time, sometimes adapting what I've seen other people do, sometimes deriving the style from what seemed to make sense to me from the syntax/semantics of the language. I find it easy on the eyes and rigorous enough to keep my code from looking organically grown. Most people who have had to play around in my code have found it easy to understand and easy to maintain. (I've had a number of comments about how nice it is that all the parameter passing is done with named notation, rather than positional. I'll leave it to the language theoreticians to go debate why that is.) I'm sure you have a style you prefer and no doubt it is different than mine. Does it accomplish the same end? All I hope to do is keep the code looking tidy (like good penmanship) and make it as clear as I can as to what is going on. Other styles may accomplish the same goals. Maybe you could post an example of what your style looks like? I'm sure there are elements of it which I and others may like to adopt. MDC -- Marin David Condic Real Time & Embedded Systems, Propulsion Systems Analysis United Technologies, Pratt & Whitney, Large Military Engines M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600 Ph: 561.796.8997 Fx: 561.796.4669 ***To reply, remove "bogon" from the domain name.*** "Eagles may soar, but a weasle never gets sucked up into a jet engine." -- Author Unknown