comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: Gnat pretty printing
Date: 1998/12/15
Date: 1998-12-15T00:00:00+00:00	[thread overview]
Message-ID: <36768133.C85363F1@pwfl.com> (raw)
In-Reply-To: wcclnke40st.fsf@world.std.com

Robert A Duff wrote:
> 
> Marin David Condic <condicma@bogon.pwfl.com> 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"?
> 
<snip>
> 
> And why do all these ":=" line up?
> 
<snip>
> 
> What's the purpose of the extra space there?
> 
<snip>
> 
> Why two lines for the Dispose?
> 
<snip>
> 
> 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




  parent reply	other threads:[~1998-12-15  0:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-09  0:00 Gnat pretty printing Matt Tyler
1998-12-09  0:00 ` David C. Hoos
1998-12-09  0:00 ` Tom Moran
1998-12-09  0:00   ` dennison
1998-12-09  0:00     ` Tom Moran
1998-12-09  0:00 ` Marin David Condic
1998-12-09  0:00   ` David C. Hoos
1998-12-10  0:00   ` Martin C. Carlisle
1998-12-11  0:00     ` Michael F Brenner
1998-12-11  0:00       ` dewarr
1998-12-11  0:00       ` Bob Collins
1998-12-11  0:00       ` Stephane Barbey
1998-12-11  0:00       ` Bryce Bardin
1998-12-11  0:00     ` Marin David Condic
1998-12-12  0:00       ` Simon Wright
1998-12-14  0:00         ` dennison
1998-12-15  0:00         ` Marin David Condic
1998-12-15  0:00           ` Matthew Heaney
1998-12-15  0:00             ` Marin David Condic
1998-12-19  0:00               ` Lieven Marchand
1998-12-15  0:00           ` dennison
1998-12-15  0:00             ` Marin David Condic
1998-12-16  0:00               ` Matthew Heaney
1998-12-16  0:00               ` dennison
1998-12-16  0:00                 ` Matthew Heaney
1998-12-16  0:00                 ` Chris Morgan
1998-12-18  0:00                   ` dewar
1998-12-17  0:00                 ` Dale Stanbrough
1998-12-12  0:00       ` Robert A Duff
1998-12-13  0:00         ` Ehud Lamm
1998-12-15  0:00         ` Marin David Condic [this message]
1998-12-14  0:00     ` Robert I. Eachus
1998-12-21  0:00     ` BARDIN Marc
1998-12-09  0:00 ` dennison
1998-12-09  0:00 ` Steve O'Neill
1998-12-10  0:00   ` okellogg
1998-12-11  0:00     ` dewarr
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox