Do we need both Visual Basic and C#?

I was reading what was new for Visual Basic 10 over on the VB Futures site, when I came across the following statement:

Overall Visual Basic 10.0 and C# 4.0 will have the closest feature parity at any point in the history of the languages, which will greatly benefit .NET developers who do work in both.

This statement refers to the language changes coming in Visual Studio 2010, such as Visual Basic getting some C#-like features, such as multiline lambdas, auto-implemented properties and implicit line continuation, and C# getting some Visual Basic-like features, such as late binding, implicit pass-by-ref and optional parameters.

I’m disappointment that the language teams feel the need to have what they call ‘co-evolution’, where any new features in one language also get added to the other. Is there any point Microsoft investing in two separate languages, if they do exactly the same thing?

In my opinion (which does not represent Microsoft’s), we would better off adding C-style macros to one of the languages, allowing us to #define the syntax differences between the two languages, and then kill off the other.

What do others think? Should Microsoft continue to support two (what are) basically the same languages, or should they attempt to differentiate them like they have done with F#?

Published Sunday, February 22, 2009 7:00 AM by David Kean

Comments

Sunday, February 22, 2009 8:56 AM by pg

# re: Do we need both Visual Basic and C#?

Keep both.

Sunday, February 22, 2009 9:39 AM by Steven

# re: Do we need both Visual Basic and C#?

And interesting question. From a development point of view it wouldn't be bad thing to concentrate on one single language. I couldn't help noticing that the VB IDE for Visual Studio is (even in VS2008) very bad compared to the quality of the C# IDE. Seems to me as if Microsoft invests more in the C# (language + tooling).

However, from a customer point of view, I don’t believe this would work. I know many companies that build their products in VB and dropping support for it will have a big impact, even if you support some kind of ‘syntax switch’. Is such a switch actually possible?

My statement above was a little tongue-in-cheek, clearly it would require more than just macros to maintain behavior between the two.
Sunday, February 22, 2009 2:39 PM by Pim

# re: Do we need both Visual Basic and C#?

Keep both (or skip C# ;-))

Sunday, February 22, 2009 3:20 PM by JP

# re: Do we need both Visual Basic and C#?

I think it's the other way around - overall the VB IDE's better than the C# IDE (error corrections, more intellisense, better EnC etc).  The one place VB's behind would be refactorings, but if you install "Refactor!" (free version) that gives you something like 30 free refactorings that work great.

That sort of shows my point - if the Visual Studio teams only had to focus on one language, there would be a lot more time to do other things; like bring Resharper# like features into the default IDE.
Sunday, February 22, 2009 3:23 PM by Kathleen Dollard

# re: Do we need both Visual Basic and C#?

I am fluent in both languages. There are a tremendous and often underestimated number of obvious and subtle differences between the two languages. I used to wish language was a reader feature with a single overarching langauge in the background. I believe these two languages can never reach that nirvana. As just one example, VB propagates null while C# does not. This means return values from comparisons are not even the same data type. At more depth though, the two languages have a different mindset with VB requiring much less arcange knowledge for the reader and C# providing a type of fluid flow that results in what would generally perceived as important standing out more. As an example of that, C# methods are virtual by default while VB methods are sealed by default.

You might be mixing C#'s behavior with Java's, C# methods aren't virtual by default.

And there are still at least a dozen features in VB that would benefit C#.

Yes, but at this moment, either language is 'good enough' - there are only really minor differences between the two.

This is not an attempt at a language war which I am far beyond. I program in both, and appreciate the values of each language. But the idea that VS2010 puts the two languages at full parity is simply incorrect.

Sunday, February 22, 2009 3:27 PM by Jeff Certain

# re: Do we need both Visual Basic and C#?

Even if C# and VB.NET arrive at feature parity (which they won't in C# 4.0/VB10), it's as much about *how* you express the language as what the language is capable of doing.

Otherwise, we might as well all go back to assembly programming.

Sunday, February 22, 2009 7:07 PM by David Nelson

# re: Do we need both Visual Basic and C#?

It is important to remember that EVEN IF the languages have full functional parity (which they won't, even in the next versions), there are still fundamental philosophical differences between the two languages. As one simple example, "String.Empty = Nothing" in VB returns true , while "string.Empty == null" in C# returns false. While C# is more technically accurate, VB more accurately reflects the expectations of some programmers (especially amateur and hobbyist programmers; no offense to any professional VB programmers, but that IS why the language was created in the first place). Again, this is a very simple example, but it reflects the philosophical design differences between the two languages. I am not convinced that these differences are minor enough to be ignored.

Moreover, even if you decide both languages don't need to exist, how do you decide which language to boot? And just as importantly, how do you convince everyone who has no experience in the language you decide to keep to make the switch, without feeling like you have abandoned them? Its not practical.

Sunday, February 22, 2009 10:11 PM by Jonathan Allen

# re: Do we need both Visual Basic and C#?

Microsoft needs both languages.

If it were not for VB, C# probably wouldn't even have the for-each loop. VB forces the C# team to support syntax they might not have even known about.

And of course it works both ways. C# pioneered the yield operator on .NET. The proposed version for VB 10 is better in many ways, but without C# no one would have even thought it possible.

The languages need to battle it out for the best syntax and user experience. Without it the languages will stagnate like Java.

Monday, February 23, 2009 1:28 AM by Joacim Andersson

# re: Do we need both Visual Basic and C#?

As a European I often wonder if we really need both Americans and Canadians in the world? I think they are too much alike and we could just dump one of them.

Do we really need more than 7500 kinds of apples in the world? Wouldn't it be enough with just one, they are all basically the same anyway.

But in a sense I agree with you, the world really didn't need yet another C-style language, but I do get the impression that you think that its VB that should be dropped.

If you haven't figured it out already I'm of course not serious.

Monday, February 23, 2009 6:32 AM by Anonymous

# re: Do we need both Visual Basic and C#?

Skip C#

Friday, March 20, 2009 8:51 AM by bob

# re: Do we need both Visual Basic and C#?

Johnathan makes a good point here about how VB and C# help each other in a competitive way. Also, I hate the evils of case sensitivity in C-style languages. I've just found that I can get things done faster with VB and I just like the syntax better. Also, the verbose nature of VB helps me to decipher code written by developers whose check-ins are routinely submitted to TheDailyWTF.

Friday, March 20, 2009 8:52 AM by Nitin Singh

# re: Do we need both Visual Basic and C#?

What about the 'with' keyword in VB, it really shortened the expression without needing to type the entire expression.

with ds  (DataSet)

   .Tables[0].Row[0]

         .Column[0].Value = "1"

         .Column[1].Value = "2"

end with

Also the 'using' keyword for disposing resources should be made available in VB (or has it been already?)

Friday, March 20, 2009 8:52 AM by Kelly Lynch

# re: Do we need both Visual Basic and C#?

"That sort of shows my point - if the Visual Studio teams only had to focus on one language, there would be a lot more time to do other things; like bring Resharper# like features into the default IDE."

That assumes that the head count to implement both languages would be allocated to a team to implement a single language. That would, more than likely, not be the case.

Actually, regardless of whether the headcount from VB was moved to C# or not, other teams (such as my old team, Code Analysis) would have to support one less language, and hence, be able to spend more time on developing additional features.
Friday, March 20, 2009 8:53 AM by Rob von Nesselrode

# re: Do we need both Visual Basic and C#?

Yup. We need both.

Whilst I use both to a similar level of inability bogged more by the .NET api than languages, there would nothing left to do after hours if the C# vs VB arguments were taken away.

Its not a life or death issue, its more important than that.

Perhaps some work to ensure the the compilers behave similarly for both languages would be useful. C# is a dog's breakfast, lunch and tea

Wednesday, April 15, 2009 12:51 PM by John

# re: Do we need both Visual Basic and C#?

The using is in VB, at least in the framework 3.5 (err, VB9).  Honestly, I don't mind both.  It's really a syntax preference at this point for me.  There are still a few trade offs in that Visual Basic provides more commands that you don't have to recreate in C# (However, if you become reliant on those commands and they change or disappear, you're stuck re-tooling your code whereas C# might be built to stand up longer).  

Either way though, I like both languages if just for having the choice in style.

Friday, June 25, 2010 7:52 AM by klaus_b@.NET

# Eine interessante Frage: Brauchen wir sowohl Visual Basic als auch C# ?

Eine interessante Frage: Brauchen wir sowohl Visual Basic als auch C# ?