Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I recently joined a new development team where the language preferences are mixed on the .net platform.

Dev 1: Knows VB.net, does not know c#
Dev 2: Knows VB.net, does not know c#
Dev 3: Knows c# and VB.net, prefers c#
Dev 4: Knows c# and VB6(VB.net should be pretty easy to pick up), prefers c#

It seems to me that the thought leaders in the .net space are c# devs almost universally. I also thought that some 3rd party tools didn't support VB.net but when I started looking into it I didn't find any good examples.

I would prefer to get the whole team on c# but if there isn't any good reason to force the issue aside from preference then I don't think that is the right choice.

Are there any reasons I should lead folks away from VB.net?

share|improve this question
4  
The verbosity within VB alone should lead you to C#... –  Aaron McIver Jan 11 '11 at 16:29
12  
Sounds to me like your development team lacks some serious leadership. Why hasn't your manager dealt with this issue? –  Randy Minder Jan 11 '11 at 16:29
2  
Why are you drifting towards VB .Net? From your diagram above the 2 devs with any skill both know C# and the others don't know any .Net at all. Surely it would be best to bring those who know neither language up to speed with C# as the two other developers already have c# skills to build upon? –  Brian Scott Jan 11 '11 at 16:32
13  
Under the hood they may be the same, but the VB syntax is the ugly wart-infested sister standing next to her hotter, well-bathed C# sister. It's syntax should be remembered only as a reference point to the blood that has spilled from many developers eyes as they gaze on their own version of hell. VB should be neutered, killed and left by the side of the road to rot in the warm summer heat. Embrace the more beautiful syntax and shun that which mother nature has chosen to forget. Choose wisely. –  Moo-Juice Jan 11 '11 at 16:40
2  
If I'm not mistaken, On Error Resume Next is for legacy support. Try Catch blocks do exist in VB.Net ... since it's .Net. –  Tony Abrams Jan 11 '11 at 16:48
show 7 more comments

migrated from stackoverflow.com Jan 11 '11 at 17:26

This question came from our site for professional and enthusiast programmers.

16 Answers

up vote 1 down vote accepted

There's no truly compelling reason to force someone to change languages unless one has a feature that's going to be particularly useful or time-saving for your project(s). They'll both compile down to IL and perform equivalently (assuming that Option Strict is on in VB.NET...otherwise you can incur penalties for late binding). Everything else truly is preferential (not to dismiss that at all, but it's not an objective metric).

I would suggest looking at job listings in your area and see which language is more prevalent both in work supply (i.e. the labor pool for both languages). Seeing which one will provide you with a bigger or better labor pool is probably going to be your most compelling metric.

share|improve this answer
show 1 more comment

Fortunately the answer is simple: there is no "best" language. All .NET languages use, at their root, functionality from the set of classes provided by the .NET Framework. Therefore, everything you can do in VB.NET you can do in C#, and vice-a-versa. The only differences among languages is merely a syntactical one.

C++, Java, and J++ programmers will prefer the non-nonsense, terse syntax of C#. Visual Basic (VB) programmers may prefer to stick with the devil they know—Visual Basic .NET's case-insensitive, pseudo-natural language approach. If you have VB programmers and they are real programmers (See Option Strict ON) you'll get the same results. VB is more verbose....C# is a ball buster with case sensitivity.

share|improve this answer
5  
Sorry to nitpick but this just isn't true. For example, how would you write an exception filter in C#? blogs.msdn.com/b/clrteam/archive/2009/08/25/… –  LukeH Jan 11 '11 at 16:34
4  
@Anna: Thus disproving your statement that "everything you can do in VB.NET you can do in C#". –  LukeH Jan 11 '11 at 16:42
2  
There are quite a few things that you simply cannot do in VB.Net that you can in c# -- see also: stackoverflow.com/q/2362381/50447 –  Rowland Shaw Jan 11 '11 at 17:23
show 3 more comments

I think @Anna Karin has a good point, so you should not have to worry about libraries. At least, I cannot remember any one that just works with c# and not with vb.net.

Another important point is that it will turn code checks more difficult between member of the same team if they are working with different languages. I think is a best idea use some commom language, to reduce friction in communication.

share|improve this answer
add comment

While I agree with the the previous answer that .NET should be the same feature wise, this is not always the case, but close enough that if you have a simple project it shouldn't matter.

The main reason I would give for switching to C# across the team is that it is the language most examples are in and most open source projects publish source code in C#. So if your team is unable to pull in such a resource you may be limiting yourself unnecessarily.

share|improve this answer
add comment

C# and VB.NET are based on .NET platform; it is important to developers who work in .NET to know .NET, principles, techniques, patterns... In that case switching between languages will not be a problem - it is mainly about syntax. In a mixed team maybe all of them should try to learn both of languages (it is not a big deal), but it can be important for the future collaboration between members of the team.

share|improve this answer
add comment

I would say the one advantage of having everyone using the same language is that it would mean that any developer could work on any part of the code.

Beyond that, VB.NET and C# differ only by syntax under .NET. And code written in both languages can coexist in the same project just fine.

share|improve this answer
add comment

Honestly a team of Dev's should be using the same language or at the very least know the same languages.

This will aid in cross-training and support amongst various applications that a dev team produces.

In the end VB vs C# is all a battle of preferences, but the team should be on the same page as to which one they are going to be using or supporting.

share|improve this answer
add comment

I would go with C# because:

  • it's more close to Java and C++ (languages very often taught in CS courses).
  • there are many resources on the Internet in C# than in VB (from what I've seen out there).
  • chances are higher to find/hire other developers that know C# better than VB (from what I've seen in my company) to maintain the project.
share|improve this answer
add comment

In fact, VB.NET has a few features that C# does not have at present: XML literals, and query syntax for using the Aggregate method in LINQ.

share|improve this answer
1  
VB.NET does not have iterators either (i.e. Yield keyword in C#). –  atconway Mar 27 '12 at 2:45
add comment

I would lean towards C# because it's less verbose and in my experience is much more prevalent on the internet. I would also argue that C# or VB.NET are easy and quick to learn, to the point where it's negligible and insignificant. The .NET framework, on the other hand is huge and a constantly evolving creature. Mastering .NET takes many years, but mastering C# or VB.NET could take a few months or less.

share|improve this answer
add comment

My opinion would be that enable contract-based development with interface, and developer should be able to code a class in whatever language he wish, and probably separate low/high level classes in different assemblies. As long, as the classes respect the requested interface and implements the requirement there should be little problem.

share|improve this answer
add comment

You might check out these three articles that compare C# and VB.NET:

They all seem to provide very logical arguments and comparisons between the two. Personally I vote for C# (my company chose C# for our ASP.NET projects when we transitioned from classic asp).

share|improve this answer
add comment

Should a c# dev switch to VB.net when the team language base is mixed?

The developer should use the .NET language that is the standard for the team. IMO, there should be one language that is used (unless an extremely compelling case can be made).

Are there any reasons I should lead folks away from VB.net?

I think most people here prefer C# but this is not so much a technical question as a political or business decision. Decide on what .NET language to use and then use it. Now obviously there a bunch of factors to consider:

  • Is there an existing codebase? What language is the majority of it written in?
  • Can the VB.NET developers easily pick up C#? Do they want to?
  • Does it financially make sense to invest in C# ramp-up/training?
  • How would any language switch impact existing deliverables?
share|improve this answer
show 1 more comment

I agree with many of the other answers here. I have been a part of two teams that have had to make this decision. In both they initially decided that the developers could choose since the two languages work together. However within the first year on both they wished they had just choosen C# and put in a new requirement that all new projects be in C#.

share|improve this answer
add comment

Reasons to use C#:

  • It's made two of your developers happy so far, and may well engladden the other two once they learn it.
  • You plan on hiring more developers at some point, and want to avoid the "20 years of VB experience" crowd.
  • You love curly braces.
  • You love life.

Reasons to use VB.NET:

  • The two devs who don't know C# absolutely refuse to learn it.
  • "Shambling along the path of least resistance" is your company motto.
  • There's a huge existing VB codebase that can't be updated.
  • You're on an H.P. Lovecraft kick, and lament the lack of "eldritch horrors" in your day-to-day life.
share|improve this answer
add comment

I was in a very similar situation back in 2003 that you are in now. I was managing a team that was moving to ASP.NET from ASP Classic. Most of our team had experience with VBScript as the defacto language for ASP, but about half of the team favored C# despite a slightly more complex migration path from ASP/VBScript. Ultimately I chose VB.NET, but in retrospect I really wish I had gone the C# route.

On the 5 year anniversary of that decision I wrote a blog article about my rationale for making the decision and tried to provide the benefit of my hindsight to other development managers trying to make that same call. Here's a link to the article:

"A Manager's Retrospective on the C# versus VB.NET Decision"

Long story short, for those who don't want to read the whole article: I don't think the project was worse off for choosing VB.NET over C#, and it probably saved us a lot of time in the short run. The biggest issue was really with recruiting. I would happily hire a C# or VB.NET programmer to work in either language. They really aren't that substantially different. However, whether deserved or not, VB.NET has a stigma that causes a good number of developers to avoid jobs where they know they will work with it as the primary language.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.