home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / programm / 2510 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  2.3 KB

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!udecc.engr.udayton.edu!blackbird.afit.af.mil!falcon.aamrl.wpafb.af.mil!bkottmann
  2. From: bkottmann@falcon.aamrl.wpafb.af.mil (Brett Kottmann)
  3. Newsgroups: comp.programming
  4. Subject: Re: Indentation/brackets
  5. Message-ID: <1992Aug27.142159.1624@falcon.aamrl.wpafb.af.mil>
  6. Date: 27 Aug 92 14:21:58 EST
  7. References: <1hTLb6#1MYrBq6PZFQH7dRMHk8DjgC0=esr@snark.thyrsus.com> <X1B604K@math.fu-berlin.de> <1606@anagld.analytics.com>
  8. Followup-To: alt.folklore.computers
  9. Organization: Logicon Technical Services, Inc.
  10. Lines: 39
  11.  
  12. In article <1606@anagld.analytics.com>, sammy@anagld.analytics.com (Sam Blackburn) writes:
  13. ...
  14. > I wrote the coding standards for my current project and they are pretty strict
  15. > by most programmers values.  TABS ARE ILLEGAL!  Since we've outlawed them all
  16. > source code looks identical on all editors.
  17. > Since our software was meant to be maintained by other programmers (as all
  18. > software should be) we came up with some pretty basic rules like:
  19. > Open and close braces are MANDATORY:
  20. > Illegal: if ( x != 0 ) x++;
  21. > Legal: if ( x != 0 )
  22. >        {
  23. >           x++;
  24. >        }
  25.  
  26.     Excellent!  This becomes second nature after a while.  It *eliminates*
  27. the else-without-bracket errors and makes the code more readable.
  28.     Except you should indent the brackets to match the code... :)
  29.  
  30. > Abbreviating variable names is discouraged.
  31. > Illegal: ce = 1;
  32. > Legal: communications_error = 1;
  33. > Again, these rules are meant to produce code that will be maintainable for
  34. > years to come.  Maintenance programmers spend way too much time figuring out
  35. > what variable names really mean or what the original programmer was TRYING to
  36. > do.  Programmers all too often code like e.e.cummings wrote poetry.  If you
  37. > have to figure out the meaning of a line of code then it is wasted time (from
  38. > a financial point of view).  CODE SHOULD BE WRITTEN TO BE MAINTAINED!
  39.  
  40.     100% agreement.
  41.  
  42.     This should also be taught in college!!
  43.  
  44. Brett--------------------------------------------------------------------------
  45.     "Why the courts don't tell a husband who has been living off his wife
  46. to go out and get a job is beyond my comprehension."--Joan Lunden
  47. -------------------------------------------------------------------------------
  48.