home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mjbtn!fincomp!root
- From: root@fincomp.raidernet.com (Neal McClain)
- Subject: Re: The Correct Way To Write C if-Statements
- Organization: Financial Computers Corp., Murfreesboro, TN
- Date: Fri, 06 Nov 1992 15:00:40 GMT
- Message-ID: <1992Nov06.150040.28045@fincomp.raidernet.com>
- References: <140742@lll-winken.LLNL.GOV>
- Lines: 70
-
- In <140742@lll-winken.LLNL.GOV> booloo@framsparc.ocf.llnl.gov (Mark Boolootian) writes:
-
- Phil - This piece finally explained to me the origin of the word CRAP,
- so I thought I'd pass it along to you. I hacked a bunch of it - the part
- which described this guy's opinion on good C code layout - on the assumption
- that you wouldn't pay any attention to it anyway (I didn't).
-
- If you do want to see the whole thing I kept a copy.
-
-
- >The following piece was written by Jim Minton, an aspiring C programmer.
- >I convinced him to let me post it to the net. Happy reading and flames
- >to /nev/dull...
-
-
-
- > The Correct Way To Write C if-Statements
- > by
- > Jim Minton
-
-
-
- <<<stuff deleted>>>
-
-
- >Problem Description
-
- >Let us begin with a brief technical description. The C language has
- >been designed so that there are several thousand possible ways to
- >write any simple if-statement. This allows great flexibility and
- >insures that no two programmers anywhere in the universe will ever
- >write an if-statement that looks like any other. As can quickly be
- >seen, however, this sometimes makes it troublesome to read Code
- >Recorded by Another Programmer (CRAP)[1]. Of course there never has
- >been any problem reading one's own code and this note would not be
- >necessary if all we ever had to read was our own code. However,
- >(Sigh), it is very often the case that we have to read CRAP[2].
-
- >An important point to remember, and one we hope is strongly
- >reinforced by reading CRAP, is that when other people read our code,
- >it is CRAP to them! Now here, you see, we have an opportunity to do
- >good-when producing CRAP for other people we can either show our
- >baser meaner natures and try to get even, or we can rise above such
- >pettiness and try to produce something that others will refer to as
- >good CRAP. We all should, in fact, strive to make others refer to
- >our code as "good CRAP." This is in fact the origin of the phrase,
- >"There's nothing like a good CRAP," which should, and probably will,
- >become the motto of our Department.
-
-
- <<<more stuff deleted>>>
-
-
- >NOTES
-
-
- <<<stuff deleted>>>
-
-
- >[2] The original acronym was "CWAP" (for Code Written by Another Programmer).
- > Unfortunately this acronym makes the speaker sound like Porky Pig, as in,
- > "You Wascally Wabbit." To avoid having world leading scientists at a large
- > prestigious laboratory sound like Porky Pig, the acronym was changed to
- > CRAP.
- >--
- >Mark Boolootian booloo@llnl.gov +1 510 423 1948
-
- Of course, he means Elmer Fudd (eh, eh, eh, eh, eh!).
-
- Neal
-