Getsuyodev, Programming is mainly used when constructing an application. Programming requires knowledge of application domains, algorithms, and programming language expertise. Programming can be developed in different logic based on developer knowledge.

C Sharp and VB.NET

C Sharp and VB.NET are the two primary languages used to program on the .NET Framework environment. Both languages use the same framework, and they both precompiled into the same byte code and then it is compiled and run at runtime. So we can say VB.NET and C# are functionally equivalent. Both C# and Visual Basic.NET share structural similarities with other modern high-level languages such as Java and C++.

But both have different in many features. Primarily keywords are different in each other language. C# is case sensitive while Visual Basic .NET is not. In VB.NET “Example” and “example” are same, but in CSHARP “Example” and “example” are two different variable names. Also, it is good to remember that C# statements always terminated by a semicolon (;).
The following are some examples of differences between VB.NET and C#.

Single Line Comments :

VB.NET	: ' ex: 'This is a single line comment
C#		: // ex: //This is a single line comment

Multi Line Comments :

VB.NET	: Not available
C#		: /*..*/	ex: /*Multi line comments */

VB.NET

If condition Then
  'vb.net code
Else
  'vb.net code
End If

C#

if(condition)
{
  //csharp code
}
else
{
  //csharp code
}

Loops

VB.Net

For counter As Integer = 0 To final
  'vb.net code
Next

C#

for(int i=0;i < final;i++)
{
  //csharp code
}

Operator (Equal)

VB.Net

a=b

C#

a==b;

Declaration

VB.Net

Dim i as Integer = 10

C#

int i=10;

Click the following link to learn more about VB.NET and C# Keywords differences

VB.NET and C# Comparison



Comments are closed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More