Just Wondering

Jim Giles jlg at lanl.gov
Tue Apr 25 04:01:16 AEST 1989


>From article <6899 at bsu-cs.bsu.edu>, by dhesi at bsu-cs.bsu.edu (Rahul Dhesi):
> [...]
> o    People may use |COUNT| and |count| to mean the same thing, but
>      mathematicians don't.  In mathematical expressions it's very useful
>      to use case distinctions for related entities.  For example,
>           Consider a graph G(V,E)
>           for each vertex v in V do
>             find an edge e in E such that e is incident on v
>             ...

Math texts also tend to use one character identifiers for all objects
under consideration.  I don't suppose you also recommend limiting
identifiers to one character?!?  Programming is a fundamentally different
process from writing math texts.  There is no a_priori reason for one
to resemble the other.  Indeed, I have argued before that the syntax
and semantics of arithmetical operators in programming languages _should_
resemble those use in standard math as much as possible.  However, I
come down on the opposite side of the issue on case sensitivity.  My
opinion: use multicharacter identifiers and _don't_ distinguish case.

So in a programming language:

      type vertex...        ! type - what you just called "V"
      vertex:: v1,v2,...    !variables of type vertex

> So what's the ideal compromise?
> 
> 1.   Keep languages case-sensitive.
 -- better yet, make case sensitivity optional.

> [...]
> 3.   (Here's the new idea)  Change the compiler (or lint) to accept
>      an optional switch that will warn you any time you declare two
>      identifiers that match except for case.  This will help you avoid
>      having both x and X in the same program if you *want* to avoid
>      this, but it won't prevent you from using a mathematical
>      convention that deliberately uses case to denote a similarity.

Better yet, make declaration of identifiers which differ only in case
strictly illegal.  Well, I guess it HAS to be just a warning for C
to be backward compatible.  Still -- a NEW language could avoid these
mistakes.

One last point.  I have a color computer a home.  To me, having a
case sensitive language is as bad as having a _color_ sensitive one.
Can you imagine?!?  Consider a program with 512 different variables,
all spelled "a".  How would _YOU_ like to try to debug such a monster?



More information about the Comp.lang.c mailing list