home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / misc / 2996 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  4.4 KB

  1. From: kers@hplb.hpl.hp.com (Chris Dollin)
  2. Date: Thu, 10 Sep 1992 08:39:00 GMT
  3. Subject: Re: Opinions on case sensitivity in programming languages?
  4. Message-ID: <KERS.92Sep10093900@cdollin.hpl.hp.com>
  5. Organization: Hewlett-Packard Laboratories, Bristol, UK.
  6. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!scd.hp.com!hplextra!otter.hpl.hp.com!hpltoad!cdollin!kers
  7. Newsgroups: comp.lang.misc
  8. References: <1992Sep10.034246.14218@oucsace.cs.ohiou.edu>
  9. Sender: news@hplb.hpl.hp.com (Usenet News Administrator)
  10. Lines: 83
  11. In-Reply-To: tswingle@oucsace.cs.ohiou.edu's message of 10 Sep 92 03:42:46 GMT
  12. Nntp-Posting-Host: cdollin.hpl.hp.com
  13.  
  14. In article ... tswingle@oucsace.cs.ohiou.edu (Tom Swingle) writes:
  15.  
  16.    1.  Do you prefer programming in a language which is case-sensitive or case-
  17.    insensitive (or does it even make a difference to you), and why?
  18.  
  19. It depends.
  20.  
  21. If the language designer has got the names of the built-in keywords and
  22. identifiers right, case-sensitive is my preference. 
  23.  
  24. By ``right'', I mean lower or mixed case; not UPPER CASE; IT'S TOO HARD TO READ
  25. AND I'M DEAF ENOUGH ALREADY.
  26.  
  27.    2.  How significant an issue is case-sensitivity in your preference toward 
  28.    one language over another?
  29.  
  30. It wouldn't make me pick a sematically or syntactically inferior language, just
  31. because it was case-sensitive; it might well induce me to write a suitable
  32. filter. 
  33.  
  34.    3.  Since this article is posted to the C and Pascal newsgroups, here is a
  35.    question for the respective users of each language:  To the C programmers,
  36.    do you feel that you would like C better if it were case-insensitive; and 
  37.    to the Pascal programmers, do you feel that you would like it better with 
  38.    case sensitivity?  
  39.  
  40. I've played both games, and with different flavours of Pascal cases. As a C
  41. programmer, I'd hate it if it were case-insensitive; of course, that might be
  42. becuase of all the code that would break. (I certainly willfully exploit
  43. case-sensitivity when writing C.)
  44.  
  45. I'd certainly prefer Pascal to be case sensitive (isn't it? I can't recall), so
  46. long as keywords and built-in names weren't made upper case.
  47.  
  48.    4.  If you were designing a language, would you make it case-sensitive, 
  49.    case- insensitive, or maybe even allow for an option to go either way. 
  50.  
  51. All the languages I have designed (ur ... that's three, I think), and most of
  52. the ones I have been co-designer of, have been case-sensitive. I'd not have an
  53. option to switch.
  54.  
  55. The only arguments I have heard against case-sensitivity have been:
  56.  
  57. (a) You have to remember the case of the letters, not just the spelling of the
  58. name. 
  59.  
  60. Response: so long as conventional use of case in names prevails, this should
  61. not be a problem. Certainly if names such as ``cooRdinaTeS'' were used, it
  62. would be HoRrIblE. But the usual use of case distinction falls into a rather
  63. smaller set of patterns, and these patterns often correspond to differences in
  64. use -- for example, leading Capitals for Type names.
  65.  
  66. In any case, similar objections apply to the common use of abbrevs in progs --
  67. one persons meat being another pers poison; is it pnt for pint or point? Env or
  68. envir for environment? rm, rem, or remove for delete? And have you had (as I
  69. have had) problems with British vs American spelling -- as in color, flavor,
  70. -ize where I'd have (and my reflexes provide) colour, flavour, -ise?
  71.  
  72. (b) Names differing only in case can be confused.
  73.  
  74. Yes, they can. But it doesn't happen very often. And names differing in a
  75. single character can often be confused, too, but we don't make a linguistic
  76. brouhaha about it. I'll happily use ``File'' for the type, and ``file'' for a
  77. variable of that type, and not expect myself, or other readers, to be confused.
  78.  
  79. (c) But it fails the telephone test!
  80.  
  81. How often do *you* read programs over the telephone? When the case is
  82. important, don't you add case markers -- ``capital String'', ``big FILE'', or
  83. voice change? The telephone test is a hint in the right direction, but it's not
  84. perfect; heavens, what about ``for'', ``four'', ``4'', ``fore''? Am I not
  85. permitted to call a variable ``#'' -- sorry, ``hash''? How do *you* pronounce
  86. ``+'', or ``==''? [OK, these aren't strictly fair; after all, we can use
  87. syntactic clues to work out what was meant. But code is primarily visual, not
  88. vocal; let's respect the strengths of the different media.]
  89.  
  90.  
  91.  
  92.  
  93. --
  94.  
  95. Regards,    | ``"I can't suit myself," said Weinbaum, a little petulantly.
  96. Kers.       | "I work for the Government".'' - Blish, "The Quincunx of Time".
  97.