tags:

views:

389

answers:

14

Should development of a new application be in C# or VB.NET?

How can we decide which language to use when there is no customer or resource requirements?

Is it dependent on the flavor which we like the most?

+1  A: 

Yes, it really does depend on what language your developers are proficient in and/or which they prefer. Personally, C# all the way as I can't stand VB syntax.

On another note, why just C# and VB.NET - if there are no requirements, why not any other language?

Daniel Frear
+11  A: 

There are more resources and sample code around C# than VB.NET, and a larger community around C# (thus more developers to hire).

But both languages are equal in power and both languages are likely to live and evolve in equal pace for a long time.

Pick the language you are most comfortable with. If you like them equally well, pick C#.

Albin Sunnanbo
If you can, definitely C#. VB.NET syntax is very unintuitive compared to the likes of C#, Java, JavaScript.
Michael
@Michael: I'm coding in VB.NET and I agree, it's just verbose and very implicit and spongy.
Bobby
A: 

My vote is with C# - largely that's due to personal experience and familiarity with the language, however in general more people seem to code in C#, which means more example code etc... on the internet.

Kragen
A: 

If I have the choice I pick C# due to my better fluency in this language.

Darin Dimitrov
+2  A: 

I think the first thing you should look at is which you are most comfortable with. What competence does your company have? As has been mentioned, there is a lot of supporting documentation around C# and a large community has sprung up around it. If you have the time and it is acceptable though, it might be a good idea to develop you skills in the language you are least proficient in, but I doubt your client would like that. :)

daft
A: 

I'd go with C# everytime. VB.NET is just awful ;-)

5arx
Oh come on, that's hardly an answer.
Dan Tao
@Dan Tao: - Lol. My reasons were ommitted for brevity. If i were to list 30% of my reasons for loathing VB.Net, it would make for an unreadably long post.
5arx
@5arx, okay, but if you list 0% of your reasons for loathing VB.Net, people will have no reason to believe you and are likely to consider you a troll. (FWIW I came to this question from [your MSO question](http://meta.stackoverflow.com/questions/64122/shouldnt-stack-overflow-reward-appropriate-wit-and-repartee).)
Lord Torgamus
Ahem. I was actually waiting for @Dan Tao to invite me to list my reasons before clogging up SO's data backend with what are (at least to those of us who've been unfortunate to have to earn our living by coding VB.Net) numerous, but still well-known reasons. @Dan Tao: Do you want me to go ahead ...?
5arx
@5arx: Go ahead if you want, but I suspect most of us have already heard most of the reasons you'll give. Of these, those that are purely syntactical in nature I have a hard time accepting as reasons why a language is "just awful" as opposed to "unattractive to my taste." The most compelling reasons I find are generally along the lines of @dkson's comment to the question, which isn't so much a criticism of VB.NET itself as of a lot of VB.NET developers (though I'll admit you can't *completely* extricate the two). But maybe I'll be surprised? Let's hear what you've got to say!
Dan Tao
@DanTao: Yes, I suspect we've heard them all before, which is why I held off listing them. And yes, many of my objections are syntactical. Like many jobbing developers with a family to provide for, I prefer the more classical, 'no nasty surprises' idiom of the C-like programming languages; C/C++/Java/JavaScript/C#/Ruby and so on.However there are other things that really do p155 me right off. Many of my other gripes are covered here: http://www.codethinked.com/post/2008/03/VBnet2c-oh-how-I-hate-thee2c-let-me-count-the-ways.aspx I have others if you want them, just shout ;-)
5arx
A: 

OK, I love VB.NET but, as you said, many developers and many office colleagues work on it so I will also go with C#.

SOF User
A: 

I developed in both language for years and if it doesn't depend on the wishes or coding guidelines of the client I go for C#. The reason for this is that during my master degree studies I was educated in C and C++ and as an ASP.NET developer I simply like to have the syntax of my code behind resemble what I type in for the client part. Javascript and C# have the same syntax like way of working so my mind doesn't constantly have to switch between VB.NET and javascript syntax.

XIII
A: 

I'd chosen C# because of:

  • Lack of verbatim strings in VB.NET. Large strings, for example, sql queries, are pain in VB.NET.
  • C#'s compiler is more "static" and catches more errors in compile time.
alxx
Does people still write sql queries in strings?..
Filip Ekberg
+1  A: 

I maintain an existing VB6 application, but I'm developing new applications in C# instead of VB.Net. The problem I have with VB.Net is that the syntax is too similar to VB6. For me, it's just hard to make a clean break and not fall back into writing VB6 syntax (as others have mentioned).

I especially had problems when porting a VB6 app to .NET. Instead of thinking about how I would rewrite it to work in .NET, I would think about what I needed to copy, paste, then modify. It's a completely different mindset. It's hard to describe, but I felt like I wasn't working with my own code and that I didn't fully understand was going on with the program, even though I wrote the original. So about 2000 LOC into the port, I started all over again in C#. After that, I was at least 2X more productive.

Nick Hebb
A: 

If you are assembling a team just for this project and intend to support it in the future, you should think of how easy it will be to find other developers that are proficient in the same language if changes are needed at a later time.

Miroslav Jeliaskoff
+2  A: 

I generally like to defend VB.NET when it's being picked on (as it is here), because it is indeed fully capable and expressive as a language and you can accomplish pretty much anything in VB.NET that you can in C#. To say that one is "more readable" or "more intuitive" than the other is undeniably 100% subjective.

That said, I don't agree that the two languages are equally powerful. At least not in all but the most up-to-date versions of the languages.

For instance, if you are using Visual Studio 2008 and thus Visual Basic 9, the following are capabilities of C# that VB.NET does not have:

  1. The yield keyword (VB.NET actually still doesn't have this, I believe)
  2. Multi-line lambda statements
  3. Lambda methods with no return value (VB9 only has single-line lambda functions, with return values)

With this in mind, if you don't really have a strong preference either way, I'd go with C# for a new project unless you're using Visual Studio 2010 with the VB10 compiler. It is more or less the same, but with a few additional (and very useful) capabilities.

One exception might be if you're doing a lot of XML serialization, in which case VB.NET's support for XML literals is quite handy.

Dan Tao
+1  A: 

The things that I know VB.NET does much, much better than C#:

  • syntactic sugar (specify one method to handle multiple interface methods? Thanks!)
  • COM Interop (Magically call VB6-style into the IDispatch interface? Yes Please!)
  • VB6 syntax familiarity

The things that C# does much better:

  • advanced programming paradigms (more better functional language capabilities with every version? Deeelish)
  • tool support (Refactoring from all directions? Critical!)
  • C++/Java syntax familiarity
Mike Burton
A: 

I use C# due to the fact that most of my experience with programming languages revolve around those with C-like syntax (Java, PHP, C++, etc). Because of this, I'm more comfortable with C#.

Swamp56