home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / ada / 3227 < prev    next >
Encoding:
Text File  |  1992-11-08  |  2.5 KB  |  63 lines

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!widget!jgg
  3. From: jgg@evb.com (John Goodsen)
  4. Subject: Re: The Obfuscated Ada Contest (was Re: An admittedly biased ...)
  5. Message-ID: <1992Nov7.191131.15260@evb.com>
  6. Organization: EVB Software Engineering, Inc.
  7. Date: Sat, 7 Nov 1992 19:11:31 GMT
  8. Lines: 53
  9.  
  10. troj@cwis.unomaha.edu (Kevin Trojanowski) writes:
  11.  
  12. >
  13. >In the group of people I work with, we have a myriad variety of styles, even
  14. >though we have a published "Ada standard" we're supposed to follow.  One of the
  15. >worst, in my mind, things people are doing in their code is preceding every
  16. >variable name with "The_".  Thus, you have statements assigning to record
  17. >componenets like this:  The_Box.The_Left_Side.The_Color
  18. >
  19. >To me, that's NOT readable.  In addition, it's very annoying to have to type
  20. >when working on the code.  What's wrong with:  Box.Left_Side.Color or something
  21. >similar?
  22. >
  23.  
  24. Try using "The_" as a prefix ONLY in cases such as parameter names.
  25. It makes the code readable on the procedure call:
  26.  
  27.        Set_Color ( The_Window => Root_Window,
  28.                    The_Color  => BLUE       );
  29.  
  30. Using "the_" as a prefix for record field names, local
  31. variables, etc. does nothing for readability, and in fact
  32. confuses the issue as shown above...
  33.  
  34.  
  35. >There are also compromises made in the "pass the world" notion.  Some 
  36. >packages do this, some do not -- we had to allow global variables in some
  37. >code, as we're dealing with X-Windows, and thus the Ada code isn't always
  38. >in "control".  X-Callbacks basically force you to use global variables.
  39. >There's a time and a place for everything.  Sometimes, globals are best,
  40. >sometimes passing as parameters is best -- to me, to try to force it into
  41. >rigid rules is a mistake, and produces hard to follow, and hard to maintain
  42. >code.
  43. >
  44. > X-Callbacks basically force you to use global variables.
  45.   ???????????????????????????????????????????????????????
  46.  
  47. X callbacks ? Xt callbacks ?  Motif Callbacks ?
  48.  
  49. All three provide mechanisms to pass client data.  Using global data
  50. in X windows will only further complicate matters if you ever want 
  51. your software to be Multi-Thread (Ada task) safe...  Possibly you've
  52. just skimmed over the ability to pass client data with callbacks ???
  53.  
  54.  
  55. $.02 + impending 50% taxation of the liberal 90's == my $.03 worth :-)
  56.  
  57. --
  58. John Goodsen                           PCIS Programme
  59. Software Process & Environments        Ada Joint Program Office       
  60. EVB Software Engineering               goodsenj@ajpo.sei.cmu.edu
  61. jgg@evb.com
  62.  
  63.