Alex Rivera | Logout

Why are many languages case sensitive?

Asked 2009-02-02T13:30:18.917
48

Why are many languages case sensitive?

Is it simply a matter of inheritance? C++ is case-sensitive because C is, Java is case-sensitive because C++ is, etc.? Or is there a more pragmatic reason behind it?

Edit
Report

4 Answers

17

ExpertSexChange

I believe this is a competitor to Stack Overflow where you have to pay to read answers. Hmm... with case insensitivity, the meaning of the site's name is ambiguous.

This is a good reason for languages being case-sensitive. Less ambiguity! Ambiguity to programmers is considered yucky.

answered 2009-02-14T19:03:46.247
9

Many (non-programming) languages (e.g. European using the Roman alphabet) are case-sensitive, so it's natural for native speakers of those languages to use upper- / lower-case distinctions.

The very idea that programming languages wouldn't be case-sensitive is a historical artifact arising from the limitations of early-generation hardware (including pre-computer teletype machines that used a 5-bit character code).

People who argue for case-blind languages must be unable to distinguish

IAmNowHere

from

IAmNowhere

(It's a joke! ;-)

answered 2009-02-02T15:13:41.297
4

The upper-case of a letter isn't a universal concept. Java uses Unicode, so if you wanted case-insensitive Java, the meaning of your program could change depending on what locale it was compiled in.

Most languages don't let you put dots or commas (or apostrophes or spaces) in the middle of integer literals, probably because that's also locale-dependent.

answered 2009-02-02T18:31:34.173
3

Case sensitivity doesn't really help case consistency.

Foo.Bar  
foo.Bar  
fOO.bAR  

In a case insensitive language that can be fixed automatically by the editor easily. In a case sensitive language fixing it it's harder as it may be legal. The editor first has to ckeck if foo.Bar and fOO.bAR exist and also has to guess that you typed with the wrong case rather than forgetting to declare the variable (as Foo is different to fOO).

answered 2009-02-02T14:09:00.303

Your Answer