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

  1. Newsgroups: comp.software-eng
  2. Path: sparky!uunet!wupost!usc!sol.ctr.columbia.edu!destroyer!ncar!csn!raven!rcd
  3. From: rcd@raven.eklektix.com (Dick Dunn)
  4. Subject: Re: C code Layout
  5. Message-ID: <1992Dec15.073140@eklektix.com>
  6. Organization: eklektix - Boulder, Colorado
  7. References: <1992Dec14.074411@eklektix.com> <1992Dec14.175533.8400@fcom.cc.utah.edu>
  8. Date: Tue, 15 Dec 1992 07:31:40 GMT
  9. Lines: 43
  10.  
  11. bryant@ced.utah.edu writes:
  12. [good stuff deleted]
  13. >one assignment was to comment the command "strings", which (from the
  14. >distribution) had (if I remember right) ONE COMMENT LINE. I don't know
  15. >who that style works for. Certainly not anyone in the class or the
  16. >instructors.
  17.  
  18. As noted elsewhere, that's Berkeley and not B'Labs.  OK, I'd find it hard
  19. to believe that strings could get away with one comment.  On the other
  20. hand, I wouldn't think it would need a lot.  Maybe we should drag this out
  21. as an example and look it over?  (It's probably under the UCB copyright,
  22. which is OK.  I'm just thinking that one real example might get us some-
  23. where.)
  24.  
  25. >i++ vs. i = i + 1? What was that about Gothic cathedrals??
  26.  
  27. You've lost me.  i++ is a C idiom; i = i + 1 looks wrong in a C program.
  28. How could an uncommon 5-token sequence be better than a common 2-token
  29. sequence?
  30.  
  31. >>Next, you've got seven lines for a very simple task:...
  32. ...
  33. >Again, too wordy for one is not enough for another. The blank lines
  34. >and "gratuitous ornaments" are very much a matter of personal style
  35. >and if used consistantly are fine for me.
  36.  
  37. Hold on.  We've got something almost objective (sorry) that's being lost
  38. here.  If you have a display window for editing/viewing a file, it's of a
  39. certain rather limited size.  (Even if it were "arbitrarily large", you can
  40. still only effectively see so much.)  There's a cognitive discontinuity:
  41. what you can take in at one glance is far more understandable than what you
  42. have to shuttle back and forth to see.
  43.  
  44. This is why the difference between one line and seven is far more than "a
  45. matter of personal style", because it may be the difference between being
  46. able to see a unit and having to break it.  It strikes close to what
  47. "overcommenting" means in a practical sense.  It explains some of the
  48. nuances of the "One True Brace Style" (the K&R positioning of braces),
  49. which seeks to minimize wasted vertical space.  It's tied up in many
  50. factors, including the way our natural language is written, but it's real.
  51. -- 
  52. Dick Dunn    rcd@eklektix.com   -or-   raven!rcd    Boulder, Colorado USA
  53.    ...Mr. Natural says, "Use the right tool for the job."
  54.