home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / edu / 1383 < prev    next >
Encoding:
Internet Message Format  |  1992-08-27  |  8.6 KB

  1. Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!burley
  2. From: burley@geech.gnu.ai.mit.edu (Craig Burley)
  3. Newsgroups: comp.edu
  4. Subject: Case Sensitivity (was Re: Small Language Wanted)
  5. Message-ID: <BURLEY.92Aug27172140@geech.gnu.ai.mit.edu>
  6. Date: 27 Aug 92 21:21:40 GMT
  7. References: <DAVIS.92Aug23010605@pacific.mps.ohio-state.edu>
  8.     <WVENABLE.92Aug26154731@algona.stats.adelaide.edu.au>
  9.     <1992Aug26.151818.1@vxdesy.desy.de>
  10. Sender: news@ai.mit.edu
  11. Followup-To: comp.edu
  12. Organization: Free Software Foundation 545 Tech Square Cambridge, MA 02139
  13. Lines: 135
  14. In-reply-to: pawlak@vxdesy.desy.de's message of 26 Aug 92 15:18:18 GMT
  15.  
  16. In article <1992Aug26.151818.1@vxdesy.desy.de> pawlak@vxdesy.desy.de writes:
  17.  
  18.    In article <WVENABLE.92Aug26154731@algona.stats.adelaide.edu.au>, wvenable@algona.stats.adelaide.edu.au (Bill Venables) writes:
  19.    >>>>>> "Michal" == pawlak <pawlak@vxdesy.desy.de> writes: 
  20.    > 
  21.    > Michal> ... about 70% of the C code I had to work with was 
  22.    > Michal> badly written because of:
  23.    > Michal> - ...
  24.    > Michal> - making use of case sensitivity (i.e. symbols 'value' and 'Value' in the
  25.    > Michal>   same program)
  26.    > Michal> - ...
  27.    > 
  28.    > I'll accept all the other points, but NOT this one.  The concept of "case"
  29.    > is a printing artefact and makes no sense in this context.  What's wrong
  30.    > with using all 52 letters in the character set?  What could be more natural
  31.    > than using "x" for a singly indexed array and "X" for a doubly indexed one?
  32.    > 
  33.    > Most versions of Fortran now do allow mixed case input (thank goodness -
  34.    > otherwise you would go deaf reading the stuff) but then to regard "i" and
  35.    > "I" as the *same* is a absolute gotcha.
  36.    > 
  37.    > It's case INsensitivity that is the real syntactic curse in any language
  38.    > (or operating system for that matter).
  39.  
  40.    Did you ever try to DISCUSS your code with someone? How do you pronounce
  41.    capital letters then? Some people have 'verbal' memory (me for instance)
  42.    - I remember the word, not its graphical representation (therefore I also
  43.    have a lot of trouble if 'unnatural' identifiers are used). What to do
  44.    with such people? They will guaranteed mix such symbols... MixeD cASe
  45.    inPUT? YES! cASe seSitIviTy? NO!
  46.  
  47.    Besides, with 31 letters allowed in identifiers I have 26^31 possible
  48.    identifiers (forgetting $, _, digits, shorter ones, etc). I don't really 
  49.    feel I need more so urgently...
  50.  
  51. The number of available identifiers has nothing to do with the issue of
  52. whether case is sensitive in a name space (like the variable and type names
  53. in a language, or the file names in a file system), unless you're dealing
  54. with an extremely constrained name space (like BASIC, with a single letter
  55. and optional single digit following it for variable names).
  56.  
  57. I used to be a major fan of case insensitivity and would design that into
  58. subsystems I wrote.  The OS I was working on generally did case insensitivity,
  59. but I felt that _true_ case insensitivity wasn't just uppercasing or
  60. lowercasing everything entered into the name space, but remembering the
  61. _original_ case of the name as entered into the space.  So my subsystems
  62. remembered the original case as entered by the user, but matched using ci
  63. so that while "Foo" might be displayed as a batch job name, it'd be matched
  64. when asking to display info on "foo", "FOO", "fOo", and so on.
  65.  
  66. I went on this way for a while, increasingly struggling with the problems
  67. this supposdly enlightened approach introduced.  For example, what about
  68. name spaces where there isn't a single, clear point of entry for a new name?
  69. What is the "registered" case of that name as used when displaying a report
  70. on names in the name space?  For example, if two Fortran (given a
  71. case-insensitive dialect as I would have designed it) programs referred
  72. to a COMMON area as /FOO/ and /foo/, which entry should hold sway in the
  73. name space representing global entities such as common blocks in the linker's
  74. map?
  75.  
  76. Then, I was subjected to seminars on internationalization, and that pretty
  77. much rooted out the last of my penchant for feeling that case insensitivity
  78. is the only way to go.  Fortunately, this happened a couple of years before
  79. my first encounter with C and four years before that with UNIX, both of
  80. which are thoroughly case-sensitive.  What I had discovered was the case
  81. _insensitivity_ was a feature that was fairly nationalistic (or at least
  82. restricted to a subset of languages), hard to internationalize well, and
  83. really a _user-friendliness_ issue that didn't necessarily _always_ belong
  84. ensconsed in name spaces such as language variable names and file systems.
  85. User interfaces constructed on top of such things could do a much better
  86. job of providing useful case-insensitivity (plus catching other typos,
  87. like exchanging "1" and "l" or "0" and "O") than could be achieved by
  88. trying to foist such features on facilities that don't need them.
  89.  
  90. That's not to say I don't think Fortran compilers should generally be
  91. case-insensitive.  It's what most Fortran users expect; it's an extension
  92. to FORTRAN 77 but standard with Fortran 90; GNU Fortran supports _only_
  93. that form of case-insensitivity (for now; I'll probably add more flexibility
  94. in the form of configuration or compiler options later); and so on.  It's
  95. just that, when designing a new language or facility with a name space, I
  96. no longer see the job of the manager of that name space as including
  97. case insensitivity.  That's now strictly the job of the user interface,
  98. if it wants to provide that feature.
  99.  
  100. Just because you have a language with case-sensitive variable names doesn't
  101. mean programmers should or will use "X" and "x" simultaneously in a program.
  102. I wouldn't do such things unless the nomenclature came directly from the
  103. branch of sciences that laid the foundation work for the software -- so
  104. intercommunication between program, programmer, and others would be made
  105. easier.  Otherwise, such uses of uppercase vs. lowercase seems to invite
  106. difficulties and misunderstandings, as suggested by the poster -- as would
  107. deliberately choosing names like "nl" with "n1" and "FOO" with "F00".
  108.  
  109. Ultimately, it's up to the programmer to choose names out of the name space
  110. that not only don't conflict within that name space, but don't conflict in
  111. the "wet" name spaces in our heads, whether verbalized or hand-written or
  112. whatever.  Forcing case-insensitivity on every language's name space is
  113. hardly the way to ensure this; in fact it might invite laziness here.  The
  114. best way is probably to have an enlightened group of programmers (in that
  115. they know what they want to avoid) along with user-interface tools that
  116. help choose names.  For example, it's a simple matter, given a user interface
  117. that knows the name space of variables and procedures in a program, to make
  118. sure a newly created name isn't so "close" to an existing name as to make
  119. typos or misreads from one to the other too easy.  (Spelling checkers that
  120. include "guess intended spelling" have had such algorithms for over a decade.)
  121.  
  122. I prefer case-sensitive languages now because I sometimes like to use the
  123. occasional capital to indicate a new word as an alternate to using an
  124. underscore or hyphen.  That doesn't mean I'll ever have both "fooBar" and
  125. "foobar", at least not intentionally; what it means is that I might have
  126. both "fooBar" and "foo_bar", where the former model always indicate a type
  127. while the latter always indicates a function (procedure in Fortran terms).
  128. I could do the exact same thing if my C compiler suddenly became
  129. case-_in_sensitive -- in fact, I think all my code would compile just fine
  130. anyway (though it'd be an interesting experiment) -- but I prefer having the
  131. compiler, in effect, "police" my code in case I accidentally did type "foobar"
  132. and meant "foo_bar" rather than the compiler's case-insensitive "guess" that
  133. I meant "fooBar".
  134.  
  135. I do know that ever since going over to the "I prefer case sensitivity, all
  136. else being equal" camp from the other camp, I've found far fewer vexing
  137. problems in areas of file-system, OS kernel, linker, and utility design.
  138.  
  139. So I suggest that case-insensitivity be thought of as an _optional_ feature
  140. to be provided in the realm of user-friendliness, but not as the _only_
  141. feature relating to effective and intelligent choice of names in a name
  142. space.  In that context, given that we now have the opportunity to use
  143. program-creating tools better than keypunches and simple line editors, I
  144. believe that realm is best handled in the user interfaces of those facilities
  145. that help create and maintain programs, _not_ in the designs of the languages
  146. in which those programs are written.
  147. --
  148.  
  149. James Craig Burley, Software Craftsperson    burley@gnu.ai.mit.edu
  150. Member of the League for Programming Freedom (LPF)
  151.