home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / software / 4982 < prev    next >
Encoding:
Text File  |  1992-12-15  |  2.0 KB  |  44 lines

  1. Newsgroups: comp.software-eng
  2. Path: sparky!uunet!usc!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!yale.edu!ira.uka.de!slsvaat!josef!kanze
  3. From: kanze@us-es.sel.de (James Kanze)
  4. Subject: Re: C code Layout
  5. In-Reply-To: lfd@cbnewsm.cb.att.com's message of Mon, 14 Dec 1992 23:55:21 GMT
  6. Message-ID: <KANZE.92Dec15171105@slsvdnt.us-es.sel.de>
  7. Sender: news@us-es.sel.de
  8. Organization: SEL
  9. References: <1992Dec14.074411@eklektix.com> <1992Dec14.175533.8400@fcom.cc.utah.edu>
  10.     <1992Dec14.235521.1557@cbnewsm.cb.att.com>
  11. Date: 15 Dec 92 17:11:05
  12. Lines: 30
  13.  
  14. In article <1992Dec14.235521.1557@cbnewsm.cb.att.com>
  15. lfd@cbnewsm.cb.att.com (Lee Derbenwick) writes:
  16.  
  17. |> One reason that I personally dislike very large comments embedded in
  18. |> the code is that they greatly reduce the amount of code within my
  19. |> visual field (whether on a screen or on paper): they increase the
  20. |> number of fingers I need to read the code.  [An interesting
  21. |> "difficulty" metric that I've seen attributed to Tom DeMarco.]
  22.  
  23. I was surprised that this argument wasn't mentioned earlier in this
  24. thread, as it seems quite popular, at least amongst Cambridge
  25. graduates, where it seems to be called the band width theory.  (A
  26. screen or a sheet of paper has a certain "band width", determined by
  27. the number of characters it can contain, and the goal is to use this
  28. band width in an optimal fashion.)
  29.  
  30. Of course, this means that you also put several short statements on
  31. the same line, code on the same line as the opening brace, etc.  And
  32. of course, you never, never leave a line blank.
  33.  
  34. This also argues for short variable names.  (They increase the chances
  35. of getting more than one statement on a line.)
  36.  
  37. In case it's not obvious from the tone of my comments, I am in total
  38. disagreement with this style.
  39. --
  40. James Kanze                             email: kanze@us-es.sel.de
  41. GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France
  42. Conseils en informatique industrielle --
  43.                    -- Beratung in industrieller Datenverarbeitung
  44.