Vb.net considered harmful

Posted by Marcus Hammarberg on February 26, 2010

I have once again been forced into using VB.NET which I am not very fond of.

My points up to now has been that the language in itself is not that bad. But the support (refactoring etc.) in Visual Studio is much worse than for C#. Also, there is a culture in the VB.NET community (as I understand) to hide complex stuff from your user. So for example you cannot see the references you have in your project until you hit “Show all files”. Another example for the sub-par support you get when using VB.NET.

My final point up to now is that the most common reason to chose VB.NET over C# is that you have VB6-programmers that is to be converted into VB.NET programmers. The problem is that VB.NET automatically (yeah, you can and SHOULD turn it off) include the Microsoft.VisualBasic in all new projects. Which gives you the possibility to continue using Visual Basic syntax and commands, such as CLen(“a string”) and completely miss the OO point in .NET framework.

You could argue that all this is opinions by me. And maybe it is, but as more advanced stuff was and is being introduced into in .NET Framework (from 3.0 and forward) VB.NET is cracking down according to me.

Lamdas and anonymous methods for example is suffering heavily from VB.NET demand on typing all parameters and the fact that you have to use a “_” as a line ending when formatting long lines.

Take a look at these two examples, from the Moq Quickstart:



I used the Developer Fusion C# to VB.NET conversion tool to translate the code as I cannot make it by hand in VB.NET. I fail every time. I also used pastie to shared the code. It doesn't support VB.NET syntax. Sorry for that.

What we now have is the language obstructing you and confusing you with syntax. That makes the whole concept harder to understand – and it’s quite hard to grasp from the outset for VB6-developers.

So from my point of view VB.NET makes your program harder to read and understand, and you have lesser support in Visual Studio (don’t know about MonoDevelop) and finally it includes all of Visual Basic so you stand the risk that your developers use non-standard syntax and commands.

Published by Marcus Hammarberg on Last updated