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

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!mjbtn!fincomp!root
  3. From: root@fincomp.raidernet.com (Neal McClain)
  4. Subject: Re: The Correct Way To Write C if-Statements
  5. Organization: Financial Computers Corp., Murfreesboro, TN
  6. Date: Fri, 06 Nov 1992 15:00:40 GMT
  7. Message-ID: <1992Nov06.150040.28045@fincomp.raidernet.com>
  8. References: <140742@lll-winken.LLNL.GOV>
  9. Lines: 70
  10.  
  11. In <140742@lll-winken.LLNL.GOV> booloo@framsparc.ocf.llnl.gov (Mark Boolootian) writes:
  12.  
  13. Phil - This piece finally explained to me the origin of the word CRAP,
  14. so I thought I'd pass it along to you.  I hacked a bunch of it - the part
  15. which described this guy's opinion on good C code layout - on the assumption
  16. that you wouldn't pay any attention to it anyway (I didn't).
  17.  
  18. If you do want to see the whole thing I kept a copy.
  19.  
  20.  
  21. >The following piece was written by Jim Minton, an aspiring C programmer.
  22. >I convinced him to let me post it to the net.  Happy reading and flames
  23. >to /nev/dull...
  24.  
  25.  
  26.  
  27. >        The Correct Way To Write C if-Statements
  28. >                by
  29. >                Jim Minton
  30.  
  31.  
  32.  
  33. <<<stuff deleted>>>
  34.  
  35.  
  36. >Problem Description
  37.  
  38. >Let us begin with a brief technical description.  The C language has 
  39. >been designed so that there are several thousand possible ways to 
  40. >write any simple if-statement.  This allows great flexibility and 
  41. >insures that no two programmers anywhere in the universe will ever 
  42. >write an if-statement that looks like any other.  As can quickly be 
  43. >seen, however, this sometimes makes it troublesome to read Code 
  44. >Recorded by Another Programmer (CRAP)[1].  Of course there never has 
  45. >been any problem reading one's own code and this note would not be 
  46. >necessary if all we ever had to read was our own code.  However, 
  47. >(Sigh), it is very often the case that we have to read CRAP[2].
  48.  
  49. >An important point to remember, and one we hope is strongly 
  50. >reinforced by reading CRAP, is that when other people read our code, 
  51. >it is CRAP to them!  Now here, you see, we have an opportunity to do 
  52. >good-when producing CRAP for other people we can either show our 
  53. >baser meaner natures and try to get even, or we can rise above such 
  54. >pettiness and try to produce something that others will refer to as 
  55. >good CRAP.  We all should, in fact, strive to make others refer to 
  56. >our code as "good CRAP."  This is in fact the origin of the phrase, 
  57. >"There's nothing like a good CRAP," which should, and probably will, 
  58. >become the motto of our Department.
  59.  
  60.  
  61. <<<more stuff deleted>>>
  62.  
  63.  
  64. >NOTES
  65.  
  66.  
  67. <<<stuff deleted>>>
  68.  
  69.  
  70. >[2] The original acronym was "CWAP" (for Code Written by Another Programmer).  
  71. >    Unfortunately this acronym makes the speaker sound like Porky Pig, as in, 
  72. >    "You Wascally Wabbit."  To avoid having world leading scientists at a large 
  73. >    prestigious laboratory sound like Porky Pig, the acronym was changed to 
  74. >    CRAP.
  75. >-- 
  76. >Mark Boolootian        booloo@llnl.gov        +1 510 423 1948
  77.  
  78. Of course, he means Elmer Fudd (eh, eh, eh, eh, eh!).
  79.  
  80. Neal
  81.