C# or VB

Since there is so much discussion about this topic in the .NET development community I figure I should give my two cents.

Microsoft’s .NET framework has evolved into a complicated but elegant beast. It allows for the same solution to be written in two different languages by compiling everything down to a Common Language Runtime. This has its major advantages. For instance, one of the developers I am working on a project with tends towards VB.NET, whereas I am a staunch C# programmer. Using .NET and the CLR, we can get along.

So what are the differences between C# and VB on the .NET framework? Truthfully there aren’t many other than syntax. But, the differences I have noticed are significant in two crucial areas.

The biggest area where VB comes up short is shear speed of the application. Several sites have mentioned benchmarks of C# vs. VB code where C# marginally comes out the winner in the speed test (I plan to test this one myself). I don’t think this should be a surprise to anyone. C# also allows the use of “unsafe” code, which is basically C style pointers, and compiles a lot faster than VB.

In the end your choice will boil down to preference, but here are my reasons to use C# over VB. If you have worked with Java or C++, stick with C#. It will look remarkably familiar, and it has some nifty language attributes that are extremely useful. Though not as powerful as Java or as fast as C++, C# is still a strong and solid language. It forces programmers to adopt good safe style (Properties), and if you are using VS2005 it has the super cool UI builder that made VB famous.

Leave a Comment