Syntax Comparisons
Visual Basic .NET terminates a block of code with End BlockName
statements (or Next
statements, for a for loop) which are more familiar for programmers with experience using T-SQL. In C#, the braces, {}
, are used to delimit blocks, which is more familiar to programmers with experience in other widely-deployed languages such as C++ and Java. Additionally, in C# if a block consists of only a single statement, the braces may be omitted.
C# is case sensitive while Visual Basic .NET is not. Thus in C# it is possible to have two variables with the same name, for example variable1
and Variable1
. Visual Studio will correct the case of variables as they are typed in VB.NET. In many cases however, case sensitivity can be useful. C# programmers typically capitalize type names and leave member and variable names lowercase. This allows, for example, fairly natural naming of method arguments: public int CalculateOrders(Customer customer)
. Of course, this can cause problems for those converting C# code to a case-insensitive language, such as Visual Basic, or to those unaccustomed to reading a case sensitive language.
Read more about this topic: Comparison Of C Sharp And Visual Basic .NET
Famous quotes containing the word comparisons:
“The surest route to breeding jealousy is to compare. Since jealousy comes from feeling less than another, comparisons only fan the fires.”
—Dorothy Corkville Briggs (20th century)