Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!bu-cs!dartvax!eleazar.dartmouth.edu!jskuskin From: jskuskin@eleazar.dartmouth.edu (Jeffrey Kuskin) Newsgroups: comp.lang.c Subject: Explanation of "Case-sensitive" Message-ID: <13174@dartvax.Dartmouth.EDU> Date: 22 Apr 89 07:00:07 GMT Sender: news@dartvax.Dartmouth.EDU Reply-To: jskuskin@eleazar.dartmouth.edu (Jeffrey Kuskin) Distribution: na Organization: Dartmouth College, Hanover, NH Lines: 30 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@eleazar.Dartmouth.EDU