To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.publishOpen lugnet.publish in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Publishing / 352
351  |  353
Subject: 
Re: Case-sensitivity in programming languages
Newsgroups: 
lugnet.publish
Date: 
Thu, 18 Feb 1999 00:03:29 GMT
Viewed: 
2094 times
  
In lugnet.publish, blisses@worldnet.att.net (Steve Bliss) writes:
Well, one of the reasons many high-level languages are case-sensitive is that
it vastly increases flexibility and expressiveness.  Languages such as Lisp,
Forth, PostScript, Perl, etc. with advanced string manipulation capabilities,
dynamic run-time typing, late binding, etc., all let you define functions and
treat them as if they were built-in language features.  Same goes for operator
and method overloading.  These extension mechanisms, usually using symbol
tables, make use of the same code used for dictionaries (e.g., hashes or
associative arrays).  This is an extremely flexible and powerful paradigm, the
effectiveness of which would be severely hampered by case-insensitivity.

If you say so.

Well, I dunno, maybe those languages wouldn't be severely hampered by case-
insensitivity.  I always thought that was the reason they were designed to be
case-sensitive.


Anyway, on the surface, it may seem restricting when a language differentiates
between 'if' and 'IF', but if the language has any real extensibility in it,
it would actually be restricting not to differentiate.

I'll disagree that it only *seems* restricting *on the surface*.  When I
read "assert(x)" and "ASSERT(x)", my brain thinks they mean the same
thing.  I've used systems where they actually mean different, I just
avoid writing anything that would rely on that approach.

OK, yes, that's certainly a readability restriction.  What I meant though was
that I felt that the advantages of case-sensitivity outweighed any
disadvantages.  I'm sure the extent to which that is true or untrue depends on
the particular language, though.


Way back in CS101, proto-CS-geeks were taught that it would be evil to
write programs using identifiers whose names differed only by the case
of their characters.  Using x and X as different variables is a bear to
debug.

Good thing for a linter to flag in most cases.  But not something the language
should inherently prevent, though, right?

I'm perfectly happy writing things like

   foreach $a (@A)  { ...$a... }

in small, short-lived, one-off scripts.  (Doesn't seem odd or gross to me, and
I'd be disappointed if I didn't have the option to write that.  Just like in
mathematics, the lowercase variables names represent set members and uppercase
variable names represent the sets to which they belong.  I'll admit, that sort
of thing is be scary to see in most programs -- especially in a non-
mathematical context.


I admit I dislike languages where keywords are case-sensitive because of
my own preferences.  I don't want to have to keep hitting the shift
and/or caps-lock.  Give me an editor that fixes the casing for me, and
I'd be happy(ier).

There was an old version of QuickBASIC back in '87 I think which fixed case
automagically as you typed...that was cool.  It even went around through your
program for you and changed foo$ to Foo$ if you changed it in one spot -- right
on the fly!  :-)


Older languages like C,
C++, Pascal, FORTRAN, BASIC, etc., however, don't really benefit much
from  case-sensitivity, ...

Which was the domain (range?) of languages I was considering.

OK, I didn't gather that from your original message expressing distaste for
case-sensitivity.  (I read it as a general blanket statement about all
programming languages...sorry.)


... except maybe for human-readability issues such as macros
conventionally being uppercase in C, so that, say, ASSERT(x) really means
something different from assert(x).

I maintain that human readability is enhanced by case-insensitivity.

For everyone or for yourself?


ASSERT and assert should be the same thing.

So there is no value then in distinguishing between, say, pchArm and pCharm?
Between Hedge and hEdge?  Carts and cArts?  pWages and pwAges?  Those should
all be pairwise equivalent?

(I'm not a fan of Hungarian Notation, but I respect other people's choice to
use it, and I understand its usefulness in the Win32 programming environment.)


I agree that the convention of macros being all-caps is fine and conveys
information to the reader.  It just shouldn't be conveying information
to the compiler.

Would you concede that case-insensitivity might be a bad thing for certain
classes of languages (Lisp/Scheme, Perl, Python, PostScript/Forth, etc.)?

--Todd



Message has 4 Replies:
  Re: Case-sensitivity in programming languages
 
While the discussion to Case or not to Case is very interesting and I hope it continues, I would like inject something at this point. A bit of history if you will. Way back when ( Mr. Peabody please set the Wayback Machine for the cusp between main (...) (26 years ago, 18-Feb-99, to lugnet.publish)
  Re: Case-sensitivity in programming languages
 
There's one problem with the 'shorter to save storage space' issue: COBOL is much older than C. I believe COBOL was the second compiled language (right after FORTRAN). C came quite a bit later, after a significant amount of improvement in the (...) (26 years ago, 18-Feb-99, to lugnet.publish)
  Re: Case-sensitivity in programming languages
 
(...) I'm reading into your response that I wasn't very clear in my earlier 'if you say so'. I meant to say that I don't have much knowledge on the languages and concepts you mentioned. I've been in a VB & SQL ghetto for the last few years. (...) (...) (26 years ago, 18-Feb-99, to lugnet.publish)
  Re: Case-sensitivity in programming languages
 
Steve Bliss wrote in message <36cd9ed5.15435527@l...et.com>... (...) Oh, geez, now were did I put that cane? (...) I had the same problem right after I exited the purely computer room environment. ( Are there any of those still left? Maybe in lower (...) (26 years ago, 19-Feb-99, to lugnet.publish)

Message is in Reply To:
  Re: Case-sensitivity in programming languages
 
[I suppose this should move to off-topic. Oh well.] (...) If you say so. (...) I'll disagree that it only *seems* restricting *on the surface*. When I read "assert(x)" and "ASSERT(x)", my brain thinks they mean the same thing. I've used systems (...) (26 years ago, 17-Feb-99, to lugnet.publish)

58 Messages in This Thread:



















Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR