tags:

views:

1226

answers:

18

I'm a web developer who is still 'stuck' in the classic asp world. I want to step up to .net but I am unsure of which language to learn - most likely out of VB or C#. Are there any compelling arguments to choose one over the other?

+23  A: 

You can accomplish anything in either language, but the development world is largely in favour of C# - and if you choose C# you'll be viewed more favourably in the market.

Craig Shearer
That's quite brutal, to be honest. But the truth hurts for VB centric people :(
Jon Limjap
Since you're using the 'british' english usage of 'favor', I have to ask, what's it in New Zealand for programming languages? Is it mostly C# for .NET? or is it like it is here in the states, with older legacy apps in VB.NET, with newer apps in C#?
George Stocker
Less key strokes = higher productivity!
cfeduke
+3  A: 

Really, no. Both have advantages and disadvantages. For me, the "clean break" from classic VB syntax to C# syntax was a strong selling point -- VB.NET is similar to, but in subtle and intricate ways different from, classic VB. I found C# easier.

OTOH, your mileage may vary. I'm fluent in both, and I think you'll find a lot of .NET developers are.

John Rudy
I'll add that if you come from a purely classic VB background, the subtle differences can get you into trouble. I've had to clean up a lot of ugly code because of this.
Joel Coehoorn
BTW: before learning .Net I had a primarily C++ background. But since moving to .Net I think that VB really has a lot to recommend it over C#. There were some things I missed when C# 3.0 came out that left VB behind, but version 10 largely closes the gap again.
Joel Coehoorn
+1  A: 

I agree with Craigrak.

In the end both languages do essentially the same thing.

Chuck Conway
+1  A: 

For the most part language is a preference and rarely offers any advantages over others.

VB contains some features C# doesn't and vice-versa but nothing you couldn't accomplish with both. I'd recommend trying C# and VB and see which you feel most comfortable with.

In the end the compile to the same language.

Chad Moran
+3  A: 

Ok so fundementally all .NET languages are the same - That's one of the .NET objectives really isn't it?

  1. Common Type System (CTS)
  2. Common Language Specification (CLS)
  3. .NET Framework Base Library
  4. All code ends up as IL
  5. Blah,Blah, Blah

From a career perspective and choice of future positions C# is the more desirable BUT VB.NET is there for a reason (e.g. learning curve maybe slightly easier if you had a VB6 background). If you haven't coded in Microsoft languages before I'd start off in c# unless you prefer the verbose VB syntax.

The take away would be to understand the architecture and concepts of the .NET collection of technologies and the languages will follow.

+9  A: 

While both languages do 'essentially the same thing', headhunters and businesses don't care about that, they care whether or not you'll be able to support and extend existing business applications. In my travels on Dice.com, Careerbuilder.com, and monster.com, I see more call for C# and ASP.NET than I do VB.NET.

In my (unscientific) survey of these sites, I found that there were one third more job openings for C# than VB.NET -- A non-trivial difference if you want to make yourself more marketable.

It may feel like a Coke and Pepsi difference, but it isn't. A VB.NET programmer still must learn C# to expand his marketability, but a C# developer need not do the same, since he already has more opportunities available.

There is some thought that VB.NET programmers are the majority of programmers, but while I see statistics quoted, I don't actually see the reports themselves, nor when they were created. The programming world moves quickly, and while VB.NET accounted for the lion's share of code samples in 2003, it doesn't seem that way in 2008.

If Google trends are any indication, C# is very far ahead of VB.NET -- A four to one difference!

George Stocker
Or you could make sure you were fluent in both.
Joel Coehoorn
I was thinking about that when I wrote my post. But, and here's a big but: There's a finite amount of time in this universe. Between Perl, ASP.NET, C#, XML, XSLT, HTML, CSS, and Javascript, I don't have much more time to spare to a language that isn't very marketable.
George Stocker
If you know C#, you can pick up VB.Net in a weekend, and vice versa. It's one more thing on your resume, if nothing else.
Adam Lassek
+1  A: 

I can't quantify this or anything, but it seems that c# programmers have an easier time coding in vb.net than vb.net programmers going to c#.

But the main selling point of c# (to me), is that because it is syntactically similar to java, knowing c# will make it a little easier for you to read java programs (of course the libraries are different, but it will still make it a little easier to see what's going on).

Giovanni Galbo
+2  A: 

As you appear to already have VB experience, it may be easier to work with VB .NET and learn about the intricacies of the .NET Framework instead of using a new framework and new language.

Zian Choy
I 100% agree, that Framework is much more important than the language. If you learn .NET in either VB or C#, you'll be able to quickly pick up the other if/when you need to.
Timothy Carter
+5  A: 

This question has been asked on StackOverflow before:

Moving to ASP.NET - VB or C#?

Here is a similar question:

Whats a good language to learn to program Windows applications?

Jason Jackson
+3  A: 

I came from classic ASP and started out using VB.NET but then switched over to C# which was a real eye-opener as I discovered I had transferred much of my 'classic' ways of doing things to the .NET world when using VB.NET. I really feel that using C# has allowed me to lose much of the 'baggage' I was carrying from Classic ASP and I feel I'm a much better developer since moving to C#. If your javascript is good and you are familiar with the C-based syntax of C# I'd recommend C#. In addition, not long ago I was looking for a job and as I have experience in both I got calls for jobs using both - the C# jobs heavily outnumbered the VB.NET jobs.

paulie
This recent article provides some interesting insights to this question:http://blog.briandicroce.com/2009/03/10/dear-vb-developer/
paulie
+3  A: 

When I first learned the .NET framework I started with VB.NET. Then I switched jobs and had to learn C#; the transition was trivial. It didn't take long to become productive in C#. Then I switched jobs again and had to go back to VB.NET. Yet again the transition was trivial. So I don't see either as better or worse in general but if I had to choose one it would be C#, I just prefer the syntax.

Some people have mentioned C# being more marketable than VB.NET. My experience has not shown that to be the case. Assuming, of course, that you can get past HR and into the technical part of the interview. At which point you simply have to sell yourself as being capable of picking up one or the other quickly.

So just pick the language that you think you will pick up the quickest. The other will come easy after that.

Jeremy Bade
A: 

The Pragmatic Programmer says that you should learn a new language every year, so if for no other reason you should learn C#. That's what I did, and then I went ad just skimmed and learned VB.Net. Since you know VB Script the change is trivial once you know concepts from C#.

Also, a lot of code samples, open source projects, and cool 3rd party tools jut don't use VB.

Charles Graham
A: 

Without a doubt C#. You can learn VB to start with, since it's a bit "easier" aka more readible, but if you want to make money programming in .NET learn C#.

For some crazy reason people pay more for C# developers. Also, there's a stigma against VB programmers in the field -- I don't know why but ther eis. learn C#

ManiacPsycho
A: 

I'd agree that there is a stigma attached to being a VB(.NET) developer. Sadly, like all stigmas, it's rather unjustified. Classic VB wasn't a full featured programming language (classes with no inheritance for example) and VBScript (which is what classic ASP used) was a joke of a language for writing anything more complex than a mail form.

But as others have already stated, VB.NET is every bit as powerful a language as C#. What I will add to that, since noone else has mentioned it yet is a couple of advantages VB.NET has over C# for web development:-

The first is very simple and easilly dismissed, but hear me out. In VB.NET when you do a string comparison in an expression it treats a null the same as a zero-length string. You have no idea how much tedious 'checking for null before doing the string comparison' that saves. Not only that but the bug hunting when you forgot to put that check in because you were sure the variable with be initialised always.

The second is that VB9 (the version of VB.NET included with Visual Studio 2008 editions) includes support for XML literals and XPath-like expressions directly in the language. It looks a bit ugly but it does condense pages of tedious XML processing code down to a few lines. And modern server-side web development spends a lot of time manipulating XML.

U62
A: 

My suggestion would be to do a little tinkering in each and then determine for yourself if one makes you seem stronger than the other. Perhaps switching to C# and its C-like structure may prove a way to take your coding up a level or two. Perhaps VB.Net has syntax close enough to VBScript that it is easier to learn and more comfortable for a reason to choose it.

Myself, I am much more a C# developer, but I can program in VB.Net as sometimes you don't have a C# version and so one has to make do with what there is. I did classic ASP but I also did some C/C++ before that as well as some during ASP's heyday as COM objects tended to be written in C/C++, at least where I worked for a couple dot-coms.

JB King
A: 

I recommend C#.

But IMHO about 70% of learning C# is learning the .NET framework.

Since VB.NET uses the exact same framework and has a similar syntax/framework learning ratio you may find it easier to learn the .NET framework first using VB.NET. coming from a classic ASP background.

Then making the transition to C# will not be as difficult as all of your method calls, etc will be the same.

There are even utilities to translate between the two languages that rely on this.

However it should be noted that one of the strengths of .NET is you can write assemblies in whatever .NET language you wish and they can be used by all.

Andy Webb
A: 

I'm a reforming c# bigot--I just prefer the c-family history and philosophy over then basic language family tradition. That said, I'm really changing my tune: VB.NET is really nice for RAD kinds of scenarios and there is almost nothing different in what you can accomplish between the two... at least in theory.

HOWEVER, I would point out that in my experience about 80% of coding examples either on the web or in print are in C#. The farther you are to the RAD side of the equasion (i.e. using wizards or dragging and dropping), that percentage goes down. The closer the kind of development you do is to the CS/engineering side of things, the more coding examples and developers you will find writing in C#. I almost never see any VB code snippets when I search the web for an answer to a .NET question... upwards of 95% are C#. This is why I said that you can do anything you want in VB.Net "at least in theory"... because its harder to get help on the net in VB (not that it's all that difficult to translate but it's pain and the last thing I want to do as I'm trying to deciper the subtlies of some particular problem).

So, for a presentation tier web developer, you gotta ask yourself if you see yourself wanting to do core engineering types of tasks of if you like doing more GUI-esque tasks such as implementing designers wireframes and that sort of thing. If you like the ligher side of development or are more Junior, then VB makes a lot of sense.

If you don't really know how to answer these questions I'd pick C#.

Kevin