From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,TO_NO_BRKTS_PCNT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 7 Nov 92 19:11:31 GMT From: widget!jgg@uunet.uu.net (John Goodsen) Subject: Re: The Obfuscated Ada Contest (was Re: An admittedly biased ...) Message-ID: <1992Nov7.191131.15260@evb.com> List-Id: 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