Our website uses cookies. By continuing we assume your permission to deploy cookies, as detailed in our cookies policy. Accept

Discussion Topics

4th February 2014

VB or C#?

Let's get practical, religion aside, with an eye on programmer productivity, here are the top 10 reasons why C# is better than VB.NET, in no particular order. If you have some other ones, let me know.

1.     In C# the line ends when I type the semicolon. The practical offshoot of this is that I write code like this:

2.     string sql = @"SELECT *

3.      FROM SomeSuchTable

4.      WHERE ID='WhatHaveYou'

                  ORDER BY ThisAndThatField ASC ";

So when someone hands you a SQL statement you can just paste it into your code and the output (i.e. carriage returns) will still keep the format. In VB.NET, you would have to write the following to keep the formatting.

dim sql as string = "SELECT *" & vbCrLf

                  sql += "FROM SomeSuchTable" & vbCrLf

                  sql += "WHERE ID='WhatHaveYou'" & vbCrLf

                  sql += "ORDER BY ThisAndThatField ASC "

And that's annoying.

5.     Increments/Decrements. a++;a--; 'Nuff said

6.     Money. No, not the data type. The green. C# developers make more money. Don't believe me? Here is the proof. Like Orwell said, War Is Peace, Freedom Is Slavery, Ignorance Is Strength and yeah, it's the same .NET framework, but Perception is Reality. Get over it. Learn it. Put it on the resume.

7.     I am not sure whether this is a valid reason, but with C# I can use Borland C# Builder which sports my beloved SDI interface, a la VB3, so that you can code full screen. This interface was also available (though not by default), in VB4,5,6 and VS.NET 2002 beta 1. The SDI interface disappeared from the VS.NET product before it shipped though. Anyway, if you miss that kind of interface, you can use it in Borland C# Builder.

8.     Error Catching. C# catches a lot more errors than VB.NET, such as uninitialized variables, dead code, etc...

9.     You get to act really snotty to VB.NET developers, yeah! That's priceless.

10. The source code to the C# compiler is available from Microsoft and Novell. This means that you can theoretically develop apps for OSes other than Windows, such as Linux and MacOS. Thanks to Jai Lue for this tidbit.

11. C# has Operator Overloading (my favorite feature from C++). Though, via the grapevine, VB.NET will have this feature in VS 2005. Thanks to Aditya Vaze for this language delicacy.

12. Comments in C# are just better. You can do multiline comments, XML comments, single line comments, etc... Thanks to German Voronin for this.

13. Regions in C# are far better. The key here is that you can place a region inside a function, thus breaking up the implementation into logical pieces. I simply love this ability.

Please register or login to comment.

Login To my Dashboard

Login with Facebook Login Forgotten Password?

Gravitas Registration Form

Login with Facebook

Apply For Position

Attached CV


Attach a different CV?

Cover Note (Optional)

word(s) remaining Apply Today

Update Personal Settings