home *** CD-ROM | disk | FTP | other *** search
- 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
- From: bkottmann@falcon.aamrl.wpafb.af.mil (Brett Kottmann)
- Newsgroups: comp.programming
- Subject: Re: Indentation/brackets
- Message-ID: <1992Aug27.142159.1624@falcon.aamrl.wpafb.af.mil>
- Date: 27 Aug 92 14:21:58 EST
- References: <1hTLb6#1MYrBq6PZFQH7dRMHk8DjgC0=esr@snark.thyrsus.com> <X1B604K@math.fu-berlin.de> <1606@anagld.analytics.com>
- Followup-To: alt.folklore.computers
- Organization: Logicon Technical Services, Inc.
- Lines: 39
-
- In article <1606@anagld.analytics.com>, sammy@anagld.analytics.com (Sam Blackburn) writes:
- ...
- > I wrote the coding standards for my current project and they are pretty strict
- > by most programmers values. TABS ARE ILLEGAL! Since we've outlawed them all
- > source code looks identical on all editors.
- >
- > Since our software was meant to be maintained by other programmers (as all
- > software should be) we came up with some pretty basic rules like:
- >
- > Open and close braces are MANDATORY:
- > Illegal: if ( x != 0 ) x++;
- > Legal: if ( x != 0 )
- > {
- > x++;
- > }
-
- Excellent! This becomes second nature after a while. It *eliminates*
- the else-without-bracket errors and makes the code more readable.
- Except you should indent the brackets to match the code... :)
-
- > Abbreviating variable names is discouraged.
- > Illegal: ce = 1;
- > Legal: communications_error = 1;
- >
- > Again, these rules are meant to produce code that will be maintainable for
- > years to come. Maintenance programmers spend way too much time figuring out
- > what variable names really mean or what the original programmer was TRYING to
- > do. Programmers all too often code like e.e.cummings wrote poetry. If you
- > have to figure out the meaning of a line of code then it is wasted time (from
- > a financial point of view). CODE SHOULD BE WRITTEN TO BE MAINTAINED!
-
- 100% agreement.
-
- This should also be taught in college!!
-
- Brett--------------------------------------------------------------------------
- "Why the courts don't tell a husband who has been living off his wife
- to go out and get a job is beyond my comprehension."--Joan Lunden
- -------------------------------------------------------------------------------
-