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:
“I dont like comparisons with football. Baseball is an entirely different game. You can watch a tight, well-played football game, but it isnt exciting if half the stadium is empty. The violence on the field must bounce off a lot of people. But you can go to a ball park on a quiet Tuesday afternoon with only a few thousand people in the place and thoroughly enjoy a one-sided game. Baseball has an aesthetic, intellectual appeal found in no other team sport.”
—Bowie Kuhn (b. 1926)