Hi,
I have been doing a number of projects in Delphi, which uses the case insensitive language Pascal, and I was wondering what the advantage of case sensitive languages is.
Jason argues that "Case insensitivity introduces much ambiguity". I don't agree. If you realize that the language is case insensitive you know that WHILE
means the same thing as while
, even if you never write the former. Same for variables and functions; camel casing is nice, but was the first letter also a capital or not? And what about functions whose name starts with an underscore? In case insensitive languages no problem: _fooBar
will do just as nicely as _FooBar
. So where's the ambiguity Jason refers to? Yes, you can write a variable in different ways, but the meaning is unambiguous! FooBar
== foobar
!
In the same thread Delnan says that Capitalization is the difference between "I had to help my uncle Jack off a horse.." and "I had to help my uncle jack off a horse.."
. Very clever :-). But rather a point against than pro case sensitivity: would you accept that your code goes haywire because of a single capitalization error? Again, in a case insensitive language, if Jack
is a person, so is jack
.
Question: is there anyone who uses this feature in case sensitive languages that you can define two different variables or functions just by different capitalization? Because that's the only advantage I can see in it. Sure, you'll say, I write the variable name with camel casing and the constant all uppercase. But IMO they're incompatible; userName
as a variable makes sense, but USERNAME
as a constant doesn't.
(I realize that many programmers use case sensitive languages, so I'm prepared for a unwelcome reception :-))
edit
The trigger for this question was Lynda.com's "ActionScript 3.0 in Flash CS3 Professional" training video, in which Todd Perkins spends half of his time emphasizing the capitalizations :-)