As in C # to the spelling of the variables are divided into VB.
As in C # to the spelling of the variables are divided into VB.
example:
dim MyArray as new Integer(){}
dim myArray as new String(){}
Klaus,
As others have mentioned VB is very intentionally not a case-sensitive language. In some ways that’s one of its strengths and inline with its design philosophy. Though there may be conventions on when to choose what case, as there are in English, also like English the casing of a word doesn’t create a completely independent entity or concept, by design. That insensitivity is easier for new programmers, more productive for intermediate and advanced developers, and allows for a far more forgiving IntelliSense experience. In all my time using the both languages I’ve never seen a situation where case-sensitivity would be of any benefit. Even when looking at C# the most common usage is differentiating properties from their backing fields and in VB the _ prefix is far more common, especially now that this convention is enshrined via auto-props. It would add a tremendous amount of complexity and virtually nonexistent benefit.
Because I honestly feel that there is absolutely no chance that VB will ever introduce case-sensitivity, even through an Option statement, I’m going to close this suggestion to free up your votes to put toward other suggestions.
Regards,
Anthony D. Green, Program Manager, Visual Basic & C# Languages Team
6 comments
-
Justin
commented
I also think this is a terrible idea.
-
Anonymous commented
Since VB 4 (or older) the declaration variable is "Dim" not "dim", the new declaration is "New" not "new".
If you like use "Option Explicit Off" and declare the variable without "Dim". -
Spiritman
commented
Sorry, I agree with the three previous comments.
-
Nick Roberts
commented
This is a change that would potentially break a lot of existing code. It could be made optional (e.g. Option Casing Strict), but this might be considered excessive.
I think this suggestion applies more compellingly to non-English languages, and possibly to the use of Greek letters in their conventional mathematical and scientific meanings.
For example, I might want to distinguish between little pi (the number or radius lengths in the circumference of any circle) and capital Pi (the product of a set of numbers). It might also be useful if the programmer is (consciensciously) using strongly abbreviated identifiers; for example it might be important to distinguish mg (milligrams) from Mg (megagrams).
-
Paul
commented
No insult intended, but it smacks of laziness to me. In practice, does any variable need to have the same name as another one, only differentiated by case? Or does it make more sense to choose meaningful names? You're creating the second variable for a reason, after all.
-
Simon Jones
commented
You cannot seriously be asking for VB to be made case sensitive.
VB has always been insensitive to case and it is one of its strengths.
Having two variables that only differ by the case of the letters in their names is just asking for trouble and there is no good reason for allowing it.