home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!widget!jgg
- From: jgg@evb.com (John Goodsen)
- Subject: Re: The Obfuscated Ada Contest (was Re: An admittedly biased ...)
- Message-ID: <1992Nov7.191131.15260@evb.com>
- Organization: EVB Software Engineering, Inc.
- Date: Sat, 7 Nov 1992 19:11:31 GMT
- Lines: 53
-
- 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 the
- >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 something
- >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
-
-