Explanation of "Case-sensitive"
Jeffrey Kuskin
jskuskin at eleazar.dartmouth.edu
Sat Apr 22 17:00:07 AEST 1989
I didn't realize this would lead to so much debate ...
What I meant by "Why is C case-sensitive" is *NOT* "Why do C compilers
accept mixed-case source files as input, as opposed to requiring single-case
(all upper case, say) source files" A compiler in this day and age which
required single-case source files would (I hope) be considered
badly outdated.
What I *DID* mean is: "Why does the C language specify that keywords,
identifiers, etc. be distinguished by case as well as by spelling."
A quick example will clarify:
In Pascal (a case-insensitive language by my definition), "myVar := 2"
is the same as "mYvAR := 2"
In C, of course, "myVar = 2" is not the same as "mYvAR = 2"; "myVar" and
"mYvAR" are 2 distinct variables because they differ in case, even though
they are spelled identically.
Why was C specified this way? A case-insensitive language puts no
restrictions on source-file formatting: symbolic constants can be
all upper case, variables all lower case, functions mixed-case, etc.
The only difference comes at compile time when silly errors (IMHO)
such as "mYvAR not declared" start to appear (when you *have* declared
"myVar").
-- Jeff Kuskin, Dartmouth College
EMAIL: jskuskin at eleazar.Dartmouth.EDU
More information about the Comp.lang.c
mailing list