comp.lang.ada
 help / color / mirror / Atom feed
From: widget!jgg@uunet.uu.net  (John Goodsen)
Subject: Re: The Obfuscated Ada Contest (was Re: An admittedly biased ...)
Date: 7 Nov 92 19:11:31 GMT	[thread overview]
Message-ID: <1992Nov7.191131.15260@evb.com> (raw)

troj@cwis.unomaha.edu (Kevin Trojanowski) writes:

>
>In the group of people I work with, we have a myriad variety of styles, even
>though we have a published "Ada standard" we're supposed to follow.  One of th
e
>worst, in my mind, things people are doing in their code is preceding every
>variable name with "The_".  Thus, you have statements assigning to record
>componenets like this:  The_Box.The_Left_Side.The_Color
>
>To me, that's NOT readable.  In addition, it's very annoying to have to type
>when working on the code.  What's wrong with:  Box.Left_Side.Color or somethin
g
>similar?
>

Try using "The_" as a prefix ONLY in cases such as parameter names.
It makes the code readable on the procedure call:

       Set_Color ( The_Window => Root_Window,
                   The_Color  => BLUE       );

Using "the_" as a prefix for record field names, local
variables, etc. does nothing for readability, and in fact
confuses the issue as shown above...


>There are also compromises made in the "pass the world" notion.  Some 
>packages do this, some do not -- we had to allow global variables in some
>code, as we're dealing with X-Windows, and thus the Ada code isn't always
>in "control".  X-Callbacks basically force you to use global variables.
>There's a time and a place for everything.  Sometimes, globals are best,
>sometimes passing as parameters is best -- to me, to try to force it into
>rigid rules is a mistake, and produces hard to follow, and hard to maintain
>code.
>
> X-Callbacks basically force you to use global variables.
  ???????????????????????????????????????????????????????

X callbacks ? Xt callbacks ?  Motif Callbacks ?

All three provide mechanisms to pass client data.  Using global data
in X windows will only further complicate matters if you ever want 
your software to be Multi-Thread (Ada task) safe...  Possibly you've
just skimmed over the ability to pass client data with callbacks ???


$.02 + impending 50% taxation of the liberal 90's == my $.03 worth :-)

--
John Goodsen                           PCIS Programme
Software Process & Environments        Ada Joint Program Office       
EVB Software Engineering               goodsenj@ajpo.sei.cmu.edu
jgg@evb.com

             reply	other threads:[~1992-11-07 19:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-11-07 19:11 John Goodsen [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-11-06 22:48 The Obfuscated Ada Contest (was Re: An admittedly biased ...) cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uwm.edu!wupost!crcnis
1992-10-25 12:25 Daniel Wengelin
1992-10-24 18:33 Alex Blakemore
1992-10-23 17:57 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!news2
1992-10-22  8:07 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!scott.skidmore.edu!psinn
replies disabled

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