Comparison of C Sharp and Visual Basic .NET - Syntax Comparisons

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:

    Decade after decade, artists came to paint the light of Provincetown, and comparisons were made to the lagoons of Venice and the marshes of Holland, but then the summer ended and most of the painters left, and the long dingy undergarment of the gray New England winter, gray as the spirit of my mood, came down to visit.
    Norman Mailer (b. 1923)