Common Genius

The online technical home of David Nelson
Welcome to Common Genius Sign in | Join | Help
in Search

Variable Irony

A commentary on technical issues ranging far and wide.

C# vs VB.NET

If you are bilingual, or if you spend any time at all in the .NET blogosphere, you have undoubtedly witnessed many of the posts/discussions/arguments/wars over which language is better, C# or VB.NET. These skirmishes range from mild to violent, and are often filled with statements like "All VB.NET users are amateurs" or "All C# users are arrogant elitists." Much of the debate is filled with FUD, and at times it seems to border on a religious war.

Let me state right here that I have used both languages in a production environment, and I do not believe either language is objectively better than the other. Many of the arguments you see on the web come down to whether "If ... Then...End If" is better than "if(...){...}". Frankly, that is a ridiculous and pointless argument. There are pros and cons to using keywords or symbols, but in the end it comes down to personal preference. However, that does not mean that the languages are identical. There are in fact real differences between the languages beyond syntax that should be considered when choosing which one to use.

 I am going to start a series of blog posts about the real differences between the languages. To start I will deal with the 2.0 versions of each language, and at the end I will explore some of the new features coming out in the 3.0 versions. Below is a partial list of the features that will be covered. If there are others that deserve to be covered, please leave a comment and let me know.

C# 2.0

Anonymous methods
Yield Return

 C# 3.0

Collection initializers

VB.NET 2.0 (VB 8)

With...End With
Optional Parameters
Declarative Event Handling
Conditional Exception Handling

VB.NET 3.0 (VB 9)

???

Compilation differences
Visual Studio IDE differences

Published Friday, November 09, 2007 2:53 AM by dnelson

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Mike said:

I have it all figured out (of course I'm a C# elitist, so I'm smart enought to figure it out):

VB.NET programmers want to learn C#, but they can't (small, child-like brains)

C# can learn VB.NET, but they won't (it sucks)

Bye!

May 5, 2008 5:18 PM
 

Felix De Herrera said:

I would like to see the 'best' of both languages combined into a new language.  There are really cool things about VB.Net and C#.  It is a no-brainer to work in either one, but it would be nice Really Nice to have a hybrid language.

Felix

May 13, 2008 8:09 PM
 

dnelson said:

@Felix,

I agree with you. I definitely prefer C#, but there are some things about VB.NET that are very useful (declarative event handling, for example). A hybrid language could be very useful.

May 14, 2008 10:02 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems