Time to retire VB.NET

Whenever I attend a MS-centric conference, you’ll most likely see that C# is the dominant language. Not by a little bit either, a lot. But VB.NET still has heavy usage in .NET, so why do conferences skew towards C#?

I’m starting to think a lot of it has to do with resources. Why, as a modern .NET developer, should I invest time in learning two statically-typed languages in .NET? If I want to devote time to understanding another .NET language, I’ll pick F#, IronRuby or another more diverse language.

At the MVP summit, I was struck on how much time, effort and energy went in to support, maintain and grow VB.NET. It all seemed like a huge waste of time, given that we already have a static language in .NET, tailor-made for .NET from the ground up.

I bet you could take the existing VB.NET team, rededicate them to building a seamless VB.NET –> C# conversion utility (yes I know they already exist), and just EOL VB.NET.

Because .NET does not need two statically typed languages. It’s just a waste of resources.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

About Jimmy Bogard

I'm a technical architect with Headspring in Austin, TX. I focus on DDD, distributed systems, and any other acronym-centric design/architecture/methodology. I created AutoMapper and am a co-author of the ASP.NET MVC in Action books.
This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://profiles.yahoo.com/u/6BKSFCTQBEUGFPGCJORKT4UBVY Andrew

    I completely agree, but you are completely forgetting that .NET is used by massive large companies who have massive IT departments that moved from VB6 to VB.NET. These are the same companies that are paying most of the bills for Microsoft, who else would pay 11k for VS2010 Ultimate Edition. or 10k a seat license for TFS?

    Abandoning VB.NET would be a giant FU to those people, and Microsoft cares way to much about those people.

  • http://dhickey.ie damianh

    According to http://www.tiobe.com/content/paperinfo/tpci/index.html VB.NET less popular (on the web anyway) than GO, but more more popular than ‘Scratch’, whatever the fuck that is. It’s less popular than Logo, lol!

    And the funny thing is, on MSDN, all the code samples default to the first tab – VB.NET. Wtf?

    • http://profiles.yahoo.com/u/6BKSFCTQBEUGFPGCJORKT4UBVY Andrew

      One of the questions I ask new developers is what websites they go to when they are at an impasse. I find that VB.NET developers always answer MSDN, where as C# people tend to say Google, Stackoverflow, etc.

      It might a chicken/egg situation, but I doubt it. More than likely it speaks to the people who are still using VB.NET.

    • http://twitter.com/mgroves Matthew D. Groves

      ” (Visual) Basic” is #8 on that list, above Ruby, Perl, and JavaScript. Some of that may be VB6 or even QuickBASIC, but still: BASIC is top 10 language, .NET or not.

    • Guest

      Not any more

  • Anonymous

    I’m with you, but I know there a tonnes of non-software-engineers who can code like crazy in VB.NET – like mech engineers, electrical engineers, a people like that – i run into them regularly… i try my C# convert pitch which gets lost

    Also, supporting VB could be real exercise for MS in making sure the IL/CLR is language independent.

    “Because .NET does not need two statically typed languages. It’s just a waste of resources.”

    You want F# to become unsupported to?

    • Anonymous

      F# is a functional language. It does things C# cannot fundamentally accomplish.

  • Jonathan Allen

    1. I was at Redmond this week and was told that Micorsoft’s own market research shows that there are still roughly the same number of VB users as there are C# users. If I recall correctly, both have well over half a million users.

    2. It may not be true now, but as of VS 2008 there were more people downloading the express version of VB than of C#.

    3. C# was not built from the ground up for .NET; rather it was built as a C-style language to attract C++ and Java developers. You can see this in some of the clumsier constructs such as the for loop and switch statement.

    4. The last PDC conference only had 1,000 attendees. With such an incredibly small sample size you cannot

    5. Unlike C#, VB has never been just a statically typed language. This is why most COM interopt is done with VB.

    6. VB is flat out easier to learn, making it a much better language for casual programmers.

    7. C# still doesn’t have declarative event handlers, XML literals, a LINQ syntax for aggregates, a LINQ syntax that doesn’t require redundant “select x” clauses (which, by the way, are subsequently removed at compile time), or the ability to write code like this:

    Private _values as new ObservableCollection(Of String)
    Private _wrappedValues as new ReadOnlyObservableCollection(Of String)(_values)

    You guys say VB is verbose, but then you go on to write stuff like this:

    private ObservableCollection _values = new ObservableCollection();
    private ReadOnlyObservableCollection _wrappedValues;
    public Foo() //make sure all the other constructors call me because the compiler is retarded
    {
    _wrappedValues = new ReadOnlyObservableCollection(_values);
    }

    So I would thank you and all the other C# fan-boys to knock off the stupid VB must die nonsense.

    • Anonymous

      This isn’t a knock on VB.NET – I started my first 3 years on VB.NET. It just seems like a waste of resources to have parallel development efforts. How much time, energy and money goes in to have feature parity?

      Also, VB is not a dynamic language. It can be late-bound, but it is not dynamic.

      I understand that VB has things that C# does not, and vice-versa. But with dynamic objects in C#, the gap between the two is quite small and limited to a rather fringe set of features.

      Again, I’m not saying to not support, or kill VB.NET. Just retire it and stop doubling-down on resources for two nearly identical languages, feature-wise.

      • http://mutedsolutions.com Derick Bailey

        vb.net can’t even do real late binding. that died with vb6. in vb.net, what people call “late binding” is just a compiler trick that uses run time reflection to find the method you’re trying to call.

        don’t remember exactly where I read this, but i seem to recall it coming from MSDN or other Microsoft source

      • http://jaredp110680.myopenid.com/ jaredpar

        What distinction are you drawing between dynamic and late bound?

        • http://profiles.google.com/jimmy.bogard Jimmy Bogard

          Option Strict Off = late binding. It means that I cannot change types, only that it’s not evaluated until runtime.

          And it results in pretty crappy performance.

    • Carlos Ribas

      Jonathan,

      I mostly agree with your post, but forgive me for asking: What is clumsy about the C# for loop?

    • http://twitter.com/pseale Peter

      I’ve literally lost more time writing this comment than writing C# for loops. But point taken. VB.NET isn’t categorically worse than C#, and is better in some ways. Fair enough.

      The point of the article is that a lot of MS resources are spent maintaining dual C#/VB.NET compatibility. E.g. project templates, MSDN documentation. If you freed up all those resources, you could throw some more resources at things people desperately need, like:

      - Another MS-funded ORM

      - Funding P&P to look into “WCF services talking to WCF services at every layer of your application” architecture (call it WCF-WCF or maybe Mecha-WCF)

      - Blowing the rest on Oslo

      Some of these may or may not be good ideas–I’m just saying this is how I would choose to spend the money–but you get the point.

  • http://www.hollman-alu.nl Aluminium Kozijnen

    I am not that much familiar about VB.net.. Can you please send me that detail about this.. Thanks for sharing this..

  • John

    Whatever arguments you have – why, why, why do you say “.NET does not need “?

    Try say “I don’t need” – and all your problems will magically disappear.

    • Anonymous

      “I don’t need state-run healthcare” – oh snap, my problems are still there ;)

  • Jens

    The only reason I code in VB.Net is because I think it’s verbosity makes it easier to read than any C-style language. The other 3 developers here in our shop all have a C-style background, but they don’t seem to mind either. At this years DevDays in Belgium, there was no VB whatsoever, I don’t really care, I can read C# good enough, it only takes me more of an effort, so if I’d had to read C# code all day, it would waste *my* resources, and I can use those better to get my job done.

    • http://profiles.yahoo.com/u/6BKSFCTQBEUGFPGCJORKT4UBVY Andrew

      I disagree with this notion of “easier to read”. We’ve got a lot of VB.NET here, and one project I converted to C# and the C# was actually a lot cleaner. The problem with VB.NET is that people tended to abuse the “with” statement, embedding withs within withs made it very difficult to tell what was going one.

      And Linq in VB.NET? It’s horrible.

      As my first post says, MS won’t abandon it due to how many corporations still use it, but I don’t really buy that it’s easier to read either.

      • Jens

        While you might find With statement within With statements dificult to read (as a matter of fact I do too, nobody here uses that technique), I find a lot of cruly braces difficult to read, I also find reading the type of something before the variable name difficult to read. The thing is that nobody want’s to take away your choice, while you want to take away mine.

        • Anonymous

          I’m not saying to take away a choice, just stop investing in two nearly identical choices. Just a ton of money for what comes down to personal preferences

  • http://jaredp110680.myopenid.com/ jaredpar

    This entire article is based on the incorrect premise that VB.Net is a static language. It’s a dynamic langauge by deafult

    • http://profiles.google.com/jimmy.bogard Jimmy Bogard

       No, it’s not. It’s late-bound. I cannot change types at runtime. I cannot add methods to types or objects. I can try to execute methods against types that are not evaluated until runtime, but that means it’s late-bound, not dynamic.   

  • http://profiles.google.com/tiendq Tien Do

    Yes, VB.NET must die. I don’t bother to say about my reason :)

  • Cgcarter11

    Did you seriously waste the time to write this article?  Considering the CLI converts both languages into CLR without limitations, this entire argument is null and void (one being better than the other).  I do develop in C# but what I don’t understand is those who only develop in C# has some sort vendetta against VB.  My question is WHO CARES?! Do you honestly think if Microsoft wasn’t making money on VB that they would continue to support/develop the product?  At some level, they are turning a buck. 
    Quite honestly, being in this game for the last 12 years anyone who I have come across suggesting one is better than the other is looked upon as ignorant (as a developer) and ameturish.  A true developer can do it in C#, VB, F#, Javascript… just to name a few and do not limit their resources available to them simply on a perception of jealousy.

    • Anonymous

      It’s not that one is better than the other, it’s just that it seems to be a tremendous waste of resources. I don’t doubt that VB is a money maker, which is why it’s still around.

      VB.NET doesn’t affect me, other than the opportunity cost at MS for feature parity with the languages. Of the languages you listed, only C# and VB.NET are alike. The others are radically different. Why invest so much in two languages that are so similar? What a waste.

  • James

    The alternative is to kill of C# and all the ‘holier than thou’ programmers

  • Dan

    Microsoft would lose a lot of business if they stopped supporting VB.NET.  There are a lot of pseudo-coders out there who will not or cannot learn another language, and nixing the product would mean nixing a lot of visual studio licensing revenue.

    In theory, I say to hell with VB.NET.  I grew up with it, after VB6, but after learning the other .NET languages, I simply don’t see any practical reason to use it.  It’s harder to write, harder to read, and it allows far too many errors to slip through the cracks.  But in practice, it’s easy to see why phasing it out isn’t really a practical option for Microsoft.

    As for the eternal VB.NET vs C# argument… well, let’s just say that there’s something to be said for readability.

    private ObservableCollection _values = new ObservableCollection();
    private ReadOnlyObservableCollection _wrappedValues;
    public Foo()
    {
    _wrappedValues = new ReadOnlyObservableCollection(_values);
    }

    vs

    Private _values as new ObservableCollection(Of String)
    Private _wrappedValues as new ReadOnlyObservableCollection(Of String)(_values)

    The VB.NET version instantiates _wrappedValues spaghetti style, in a way that is not blatantly obvious to anyone glancing at the class.  It is essentially an invisible GOTO statement, in a magically invisible constructor, which references class variables that may or may not be changed later on.  That means that, come debugging time, you have absolutely no choice but to look through each and every variable declaration to see if pulling execution away from -the actual constructor(s)-.

    In the C# version, if you want to know what happens to an instance variable, you follow the flow of code.  I.e. you’re not chasing phantom GOTO statements, to say nothing of VB.NET’s piss-poor type safety.

    That brings me to my next point… the easy to learn argument.  No, VB.NET is not easy to learn.  It’s easy to muddle through, leaving in its wake programmers who think they know what they are doing, when really all they know how to do is write code that doesn’t cause compiler errors.  In VB, that doesn’t say much, because VB will usually compile no matter how crappy and/or disorganized your program is.  VB -is- more approachable, because it uses a lot more words and doesn’t throw a fit when you introduce bugs.

    This is coming from a 6-year VB6 developer who resisted the change to .NET, and then resisted the trend toward C# for another 2-3 years.  After learning C# and F#, I’ll never look back.  I cringe every time I have to work with BASIC in any form.  But I was in your camp for a long, long time, Jonathan.

    • Erx

      Oh my god dude, the “New” keyword is colored and visible. The fact that you can do that in 3 letters whereas you need to practically write the entire line again in C# is a big win for VB.NET. Oh, and guess what? I don’t have to use “New”. I can do it the C# way in VB as well – get it, more options? VB is heaps more readable and user-friendly. I’ve never had the problem you’ve mentioned about instantiating or looking for it etc.

      Heard of Option Strict On? Yeah, options my friend, options that C# does not have. You think having these options makes you a bad programmer, but you are dead wrong. It really does depend on the person/programmer. You may need the “help” of the software to make you code in a manner you believe is “responsible”, but not everyone needs their hand to be held by the teacher that is C#, some people can code very well in VB – i’m sorry to hear that you are not able to, just don’t go around assuming that everyone isn’t able to.

  • Guest

    God Damn i love bashing on VB

  • Hannes

    you are right, I prefer VB.NET but can read and write also C#. I dont think there are really much resources in game. The new waste is JavaScript vs C#. Samples, Docs, Sessions all done with JS

  • VB Must Die

    VB programmers are mostly casual programmers, they learned to code with “VB for dummies” and they haven’t any real IT education. They can only code in VB, they don’t know any other language and when they try to code in another language they code like in VB, they don’t event understand xml and html.
    We had to convert some VB web applications to C# and what we have seen in those applications was horror code, we laughed at it and we cried because we had to rewrite the whole code! Any student at the first year of any informatics school can code better than them.

    • andyrwebman

      Odd, I and most of my department write in Vb.net but have used several other languages.
      We’re keen on standards and good practice. We like encapsulation and separation of concerns. We like VB.net because its clear syntax makes classes and methods into friendly english statements whose truths leap out at you, instead of hiding in cryptic gobbledegook/

      And yes, we have done old fashioned Vb6 coding which did suffer from all the shortcomings you mention. Vb.net, though, is a fine platform for OO coding. You don’t need code to be in obscure symbols to encourage good practice.

      I have over 14 years of experience, and I doubt that the first years can code better than me. You speak balderdash

    • Erx

      Its sad whenever i hear a C# dev try to pick on VB, because its a fail almost every time. The reason being, you need to use this part of your life to try and make yourself feel more important, talented or intelligent to yourself and even perhaps to other people that you have not even met. It’s called having an inferiority complex, and you trying to use the language you have subscribed to or the car you have brought as an indicator to prove your superiority over others. Its sad, and i bet that you are an adult, which makes it even sadder.

      I’m sorry but the obvious just sometimes needs to be said.