Differences between VB.Net and C#.Net

Its a subjective matter which language is best.,Well this is the most debatable issue in

.NET community and people treat there languages like religion.
Some people like VB.NET’s natural style and some people like professional and terse C#



syntaxes.Both use the same framework and speed is also very much
equivalents.

But still lets see some major differences between them :-


Advantages VB.NET :-
  • Has support for optional parameters which makes COM interoperability much easy.
  • With Option Strict off late binding is supported.Legacy VB functionalities can be
    used by using Microsoft.Visual Basic name-space.
  • Has the WITH construct which is not in C#.
  • The VB.NET part of Visual Studio .NET compiles your code in the background.
  • While this is considered an advantage for small projects, people creating very large projects have found that the IDE slows down considerably as the project gets larger.

Advantages of C#
XML documentation is generated from source code but this is now been incorporated
in Whidbey.
  • Operator overloading which is not in current VB.NET but is been introduced in
    Whidbey.
  • The using statement, which makes unmanaged resource disposal simple.
  • Access to Unsafe code. This allows pointer arithmetic etc, and can improve
    performance in some situations. However, it is not to be used lightly, as a lot of the
    normal safety of C# is lost (as the name implies).This is the major difference that you
    can access unmanaged code in C# and not in VB.NET.

Share it

6 comments:

  • James said... March 6, 2011 at 3:05 AM

    Hate to tell you but.

    C# Has support for optional params. How does string.format work? You can also use it with pinvoke for com operations with variable arguments lists.

    Visual Studio also compiles c# code in the background.

  • Rajeshmani Jenu said... March 15, 2011 at 8:01 PM

    Hi james., Sorry for the late reply., I am little bit busy with my work. I would like appreciate you first for sharing your views.

    Yes you are right., we have an visioning issue in C# from c# 4.0 options parameters are working.

  • Cegonsoft said... July 29, 2011 at 6:48 PM

    Really, Your information very useful for while entering the interview panel, thanks for your valuable post...
    Cegonsoft

  • sireesha said... March 15, 2013 at 6:36 PM

    very informative site

  • sireesha said... March 16, 2013 at 10:38 AM

    i found this very informative thanks a lot for sharing

  • zeniya opi said... July 12, 2013 at 8:28 PM

    Convert your VB programs to C# with over 99% accuracy with the VBConversions VB.Net to C# Converter, the most accurate VB.Net to C# Converter available. It won the coveted Visual Studio Magazine Reader's Choice Award in the developer tools category. It was chosen by real world developers in the field just like you. A free download is available at www.vbconversions.com.

    The most difficult features other programs don't even attempt are converted, such as LINQ, embedded XML, parameterized properties, local shared variables, On Error Goto statements, event handling, complex Case statements, API calls, and more.

    Don't take our word for it. Download a Free Trial Copy Today at www.vbconversions.com and check it out for yourself.

    vb to c# converter

Post a Comment