CodeSeeker

Just another .NET developer trying to do the right thing
posts - 14, comments - 17, trackbacks - 0

My Links

News

Archives

Blogs

Which is better, C# or VB?


The age-old question. And the first answer should always be: "Yes." Because they both use the same .NET Framework classes, they both compile to the same intermediate language, and there is functionally no difference between the two. Syntactically, they are different, but they can both do the same things.

That being said, I will admit that I have a bias towards C#. I am currently working in VB, but that's not completely by choice, that's just what my current group uses. I like that because I'm learning something new and VB does have a significant user base. But most of my programming experience is in C#, Java, and C/C++, all of which have similar control structures.

But the other thing that recently convinced me that C# is better than VB doesn't have anything to do with the language itself, but with the community around the language. I went to a talk at the local .NET User Group on a new technology called LINQ. LINQ is not quite ready for prime time, but has already gone through a significant evolution. From what I gathered at the meeting, LINQ support for C# evolved prior to its support for VB. Examples were in C# before VB, etc.

This is a common theme that I encounter as I Google answers to my technical problems: I find advanced programming examples in C# many times more frequently and much easier than I find them in VB. It seems as though there are more sophisticated C# developers than there are sophisticated VB developers.

This makes sense from a historical perspective (however recent). C# grew out of C++, hence C. The C/C++ developers historically have been scientists working on very sophisticated problems. VB grew out of BASIC and its subsequent versions (of which I have worked in a couple). This was not a language that was historically used to solve very complex problems. When I first learned it in 8th grade and at the Community College level, it was convenient as a language that was easy to learn and good for teaching basic programming concepts in (hence the name, BASIC).

So, although the religious arguments will rage on about which is better, I will throw this additional opinion and viewpoint into the fray. Do with it what you will.

Print | posted on Monday, July 23, 2007 11:26 AM |

Feedback

Gravatar

# re: Which is better, C# or VB?

For me the fact that C# can do unsafe code blocks and unsigned integers / longs makes it the clear winner.
7/23/2007 3:24 PM | Lorin Thwaits
Gravatar

# VB obviously :)

For me the fact that VB can't do unsafe code is a plus as it forces the developer to find a better way than relying on unsafe code.

There is a better way: the vb.net way! :)

Only kidding, I just don't feel the need to write unsafe code. And when I do I compile a single assembly in C# that provides me with the functionality. I just prefer writing in VB, and don't like curly brackets: just preference...
7/24/2007 1:22 AM | Martin Hinshelwood
Gravatar

# re: Which is better, C# or VB?

I grew up in VB, so of course I like VB.NET...

However, I'd like to add a couple of points:

1) Case Sensitivity is the stupidest "feature" I can imagine in a modern programming language.

2) I do like the way C# handles multiple attributes on a method, with the [Attribute1] on one line, and [Attribute2] on the next line, without the awful line continuation characters VB.NET makes you deal with.

3) In a very few cases, one language is clearly "the only choice." Such as Office development (VB.NET), and Xbox (C#).


7/24/2007 4:28 AM | Travis Laborde
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: