Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's the advantage of case sensitive languages over case insensitive ones?
    text
    copied!<p>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.<br> Jason <a href="https://stackoverflow.com/questions/309300/defend-php-convince-me-it-isnt-horrible">argues</a> that "Case insensitivity introduces much ambiguity". I don't agree. If you realize that the language is case insensitive you know that <code>WHILE</code> means the same thing as <code>while</code>, 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: <code>_fooBar</code> will do just as nicely as <code>_FooBar</code>. So where's the ambiguity Jason refers to? Yes, you can write a variable in different ways, but the meaning is unambiguous! <code>FooBar</code> == <code>foobar</code>!</p> <p>In the same thread Delnan <a href="https://stackoverflow.com/questions/309300/defend-php-convince-me-it-isnt-horrible/3900114#3900114">says</a> that <code>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.."</code>. 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 <code>Jack</code> is a person, so is <code>jack</code>. </p> <p><strong>Question</strong>: 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; <code>userName</code> as a variable makes sense, but <code>USERNAME</code> as a constant doesn't. </p> <p>(I realize that many programmers use case sensitive languages, so I'm prepared for a unwelcome reception :-))</p> <p><strong>edit</strong><br> 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 :-)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload