home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / software / 5233 < prev    next >
Encoding:
Text File  |  1993-01-06  |  6.5 KB  |  173 lines

  1. Newsgroups: comp.software-eng
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!george.arc.nasa.gov!lehman
  3. From: lehman@george.arc.nasa.gov (John Lehman -- GDP)
  4. Subject: The tool is the (servant, master). Was: average identifier length.
  5. Message-ID: <1993Jan6.210943.26433@news.arc.nasa.gov>
  6. Summary: If its use is NOT optional, then it's probably a burden.
  7. Sender: usenet@news.arc.nasa.gov
  8. Organization: NASA Ames Research Center, Moffett Field, CA
  9. References: <1992Dec15.131302.22615@b30.ingr.com> <1992Dec16.080001@eklektix.com> <1520@gistdev.gist.com>
  10. Date: Wed, 6 Jan 1993 21:09:43 GMT
  11. Lines: 160
  12.  
  13.  
  14. Flint Pellet writes:
  15.  >  A good number of years ago I worked in a
  16.  > language where the convention "the rest of the world used" was that
  17.  > a particular variable began with the two letters "nl" followed by digits.
  18.  > (The n denoted integers, the letter l denoted "local".)  Unfortunately, 
  19.  > all the printed output went thru machines where the 1 and l used the
  20.  > same character, which meant that an n11 (the eleventh global
  21.  > integer) was indistinguishable from nl1: both printed as nll.  The
  22.  > whole world was using typewriters like that, so I could not just
  23.  > blithely say I needed a better printer.
  24.  
  25.  
  26. That's a great example.  Even if 99% of the world's printers
  27. use 2 characters for 1 and l, that's not much consolation
  28. to the people who use the other 1%, who may be constrained 
  29. by time and money to use what they've got.
  30.  
  31. What is the lesson to be learned from the example?  
  32.  
  33. Well, I'd say, the moral is that you can't be completely
  34. sure that your work is good until the end user has finished 
  35. using it; and all you can do is try to anticipate _and_ 
  36. _test_ as much as you can.  (In this case, print the code 
  37. on a printer and have a new person read it.)
  38.  
  39. Anyway, printer capability or not, it should be common sense
  40. that 1 and l are going to look very much alike.  _If_ one has
  41. the time to address such issues, then it might be good to
  42. run a lint-like checker over the code, to look for 1's, l's,
  43. 0's, O's, and whatever else could lead to confusion.  
  44.  
  45. (Of course one does want to be able to use ordinary words in a 
  46. program, like "local", which does have two l's in it.  No-one 
  47. would confuse that with 1oca1.)
  48.  
  49.  
  50. To the person who pointed out, regarding \<i\> etc., that
  51. saving keystrokes ala Taylor, by using the shortest possible
  52. variable names, has little relevance to today's programmer:
  53.  
  54. Yes, of course you're right.  The more important thing is
  55. how clearly understandable the code is.
  56.  
  57.  
  58. "Don't hold your breath" for a widely adopted standard
  59. on how to make code (or anything else) clearly understandable.  
  60. One way is to use simple sentences in code comments
  61. (or in writing papers); and to write for a naive reader.  
  62. I also like to use short paragraphs!  I find them easier 
  63. to comprehend.  (I am guilty, if that's the word, of
  64. using long sentences, though.)  Short lines of text
  65. are good too.
  66.  
  67. Character recognition is a less significant issue.
  68.  
  69. For myself, to avoid character recognition problems,
  70. I've toyed with the idea of using a character set without
  71. 0, O, 1, l, 2, Z, 5, S.  But, that would be too restrictive:
  72. one also wants to be able to use the full alphabet and digit 
  73. set, and write code that's similar to natural language.
  74.  
  75.  
  76. Re:  "the tool is the servant, not the master":  
  77.  
  78. If I am getting a tutorial file off the net, and the 
  79. only copy I can find is a TeX file, then for me, TeX 
  80. is the master rather than the servant, at that point.  
  81. A lot of times I don't even HAVE a printer.  But if 
  82. I can get my hands on plain text, then the tools to 
  83. manipulate it are no burden:  I just use them naturally 
  84. to do whatever _I_ want to do.
  85.  
  86. (TeX is a tool for typesetting documents.  I'll write
  87. more about "typesetting", below.  For that, please
  88. remember the above example about getting a document
  89. file off the net.)
  90.  
  91. A tool capability can become a tool burden, if its use
  92. is NOT optional.
  93.  
  94. Enhanced capabilities of tools, which people are forced 
  95. to use, lead to no end of problems.  Some of the problems 
  96. may not surface until after a long time and far away.  
  97.  
  98. If one wants to be safer, then there should be a 
  99. justification for every new feature used.  Don't use 
  100. a new capability which you don't need!  Spend a little 
  101. time deciding what you need.
  102.  
  103.  
  104.  
  105. My peeve is typesetting.  The following may seem like
  106. railing.  It is related to the idea that the tool should
  107. be the servant, not the master.
  108.  
  109.  
  110. Typesetting is fine for getting a nice-looking document, 
  111. a persuasive document, even a more-clearly-readable 
  112. document in some cases.  
  113.  
  114.  
  115. _But_, for those rare :-) cases where one actually has 
  116. some important information :-!) which one wants to be 
  117. clearly _understood_, 
  118.  
  119.               and 
  120.  
  121. one wants the essential information to be _accessible_, 
  122. to a wide audience, or in a wide variety of circumstances 
  123. (including access by computers), 
  124.  
  125. then plain text is better than a typeset document.
  126.  
  127.  
  128. Even in restricted circumstances such as writing one
  129. paper for one group of people, plain text is sufficient
  130. to get the meaning across.
  131.  
  132. I do use typesetting programs.  They're fun, when I 
  133. have the time to play around with them.  I justify 
  134. the time spent by saying, people are used to typeset 
  135. documents and they'll pay more attention to my paper 
  136. if it is neatly typeset.  
  137.  
  138. But that's all there is to it.  
  139.  
  140. I apologize to typesetters and to people who write 
  141. typesetting programs.  It's just that your tools have 
  142. been misused by computer people.
  143.  
  144. The typesetting tools add very little to comprehension 
  145. of the material; and some accessibility of the material 
  146. is lost (one can now only access it through a printer,
  147. and it is necessary to use certain software to decipher
  148. it).  
  149.  
  150. Typesetting is a trick to persuade people to read the 
  151. paper.  
  152.  
  153. (Similarly, (to make the connection to the subject
  154. matter of "comp.software-eng" more obvious) some software 
  155. enhancements are more show than go.)
  156.  
  157. The typesetting race is like the arms race and it is 
  158. like the Wall Street rat race.  It doesn't produce
  159. much that is useful, but it spurs the economy by keeping
  160. everyone running around in circles.
  161.  
  162. I would contend that this message which I have just
  163. written, if it is not clearly understood, is not
  164. the fault of its format or font, but rather the fault
  165. of my sentences and paragraphs.  Also, if this message 
  166. is useful, then that usefulness is furthered by the 
  167. plainness of the format.  How many of you would have 
  168. read it if you could only obtain it in Postscript or 
  169. TeX or Microsoft Word format (or all three)?
  170.                                   
  171.  
  172. lehman@ames.arc.nasa.gov  
  173.