C# vs. VB.NET again

In one of the questions posted on the C# Frequently Asked Questions blog, they talk about the advantages of C# over VB.NET. As always, this is something a lot of discussions have been going around, but it’s nice to hear a sum up from the C# team itself. But with some of the points I seriously question their opinion on some of the legacy stuff.

Some of the VB.NET advantages:

  • Support for optional parameters – very handy for some COM interoperability
    Seriously, couldn’t this be promoted differently? I know some VB.NET developers still using this feature, because it’s so handy, and not just for COM interoperability. Isn’t it just legacy, still available in a very new development platform?

  • Various legacy VB functions (provided in the Microsoft.VisualBasic namespace)
    Again, this legacy, why did they add this to .NET? They only reason I can think of, why this is still here, is because their VB2VB.NET converter couldn’t handle those functions. Or am I missing something here?

  • The with construct: it’s a matter of debate as to wether this is an advantage or not, but it’s certainly a difference.
    Now this I could live with, the with construct. On the Ask a C# Language Designer page they try to answer this and the only reasons are because there are only small or non-existent readability benefits (which I don’t agree with), increased language complexity (which is not my problem) and because of the C++ heritage (which I also don’t get, because C# was promoted to have the benefits of multiple languages). They even admit the with construct delivers more performance.

Then ofcourse the C# advantages:

  • XML documentation
    NDoc rules, doesn’t it?! 🙂

And then some other things like operator overloading, using statement and unsafe code, which just aren’t in VB.NET.
Anyway, my point is, that the legacy advantages of VB.NET aren’t advantages. I still don’t care what choice people make or what language I have to develop my projects in (although I prefer C#) I just don’t get it when people come up with these legacy advantages.

You may also like...

9 Responses

  1. Plien says:

    The most important advantage of VB.NET over C# is not in the language itself.

    it is in the intellisense.

    If you are typing for example :

    Textbox.text or TExtbox.text or TextBox.Text

    it is all completely correct intellisensed…

    Not in c#.

    That is the thing I have against C#. So not the language but the inferior Intellisense !!!

  2. I think you’re not really right about this.

    (Frans, how’s that, "I think" ??? I love paying attention to how I write things down 😉

    When you typ a word (variable, property, whatever) all lowercase and you press ctrl+space then (just like in VB.NET) it completes the word for you. When it’s available in different caps (like Textbox, textbox and TextBox) it presents you with a dropdown where you can choose these, highlighting the first it comes across.

    The other thing is indeed case sensitivity. When from the VB(.NET) world, you have to get adjusted to it for a while, but after some time, you’re used to it and it’s more natural then living without it. 😉

  3. Patrick Wellink says:

    in VB.Net Intellisense I dont have to use control + space….. just hit enter on the last letter and see it change. But NOT in C#.

    In C# you will get the error during compilation. (tsssssssssssssss) Yeah really increasing productivity….. (Not)

  4. Mischa Kroon says:

    Intellisence in VB.NET is better because of the background compilation that it does.

    Squigly’s rule 🙂

    BTW most important advantage of C# not in there:

    Use of unsafe code.

  5. Jan says:

    Look, it doesn’t matter which language you use. I’ve now done both and there’s hardly any difference.

    As for the NDOC options. If I’m not mistaken, VB.Net 2003 also offers this option. And if not, then it will be in the next version.

    Even Microsoft staff I know say that there’s hardly any difference, other than the backwards compatibility of some old style VB6 code.

    But developers that want to migrate to .Net should start with C#, especially if they have VB6 experience. It forces them to get to know the .Net framework. When they use VB.Net they stand the risk of using VB6-like code and not getting to know the new features of .Net.

  6. Jon Skeet says:

    Just to make sure there’s no confusion: I wrote the blog entry in the C# FAQ (with various bits of feedback), but I’m not from Microsoft. I’m an MVP, but that’s as far as the link goes, basically.

  7. Ed Witkovic says:

    Think of C# and VB.NET as nothing more then tools in a toolbox. Depending on your previous experience with the tool and the type of work you are doing, you will select a tool that meets the need. Looking ahead to future releases of C# and VB.NET, one should use C# for building frameworks and object models and use VB.NET for presentation work or small applications (RAD stuff).

  8. Ashish Sheth says:

    Never talk about intellisense – it is not a feature of language, it is a feature of VisualStudio.NET or the particular tool which u r using for development. what if u develop ur code using just NOTEPAD or what the tool which u r using don’t have intellisense feature – now tell me which language is better – C# or VB.NET

    I say both languages are equal as long as u want to develop CLS compliant code. Outside the CLS compliancy, it depends on ur requirements.

  9. VK says:

    But, guys, this issue is discussed for a long time. But, no solution came out.

    Which is better ?


    Comparing these two is foolishness ?

Leave a Reply

Your email address will not be published. Required fields are marked *