views:

1097

answers:

23

I started with VB4 way back in the day, so working in VB.NET isn't entirely new to me.

Recently, I've been working mostly with C# (I also have a background in C++), but I started maintaining a project that was written in VB.NET. Most of my existing .NET and VB skills transferred over, which was nice, but I would imagine that other people may not have worked with VB before C#.

How important is it in the real world to be fluent in both C# and VB.NET?

+7  A: 

That entirely depends on your context - it sounds like it's important for you to be at least reasonably comfortable in VB, as you're maintaining a VB project.

Many C# or VB developers will never need to deal with code in the other language - although for the sake of having a wider variety of blog reading, it's at least useful to be mildly familiar. (That's probably more important for VB developers - there seem to be more blogs giving sample code in C# than in VB.)

Jon Skeet
+2  A: 

I'd say it's important so that, regardless of your own preference, you can look at other developers' code and even work with them on it without being useless. That said, it's very easy to be fluent in both if you're fluent in one. It's pretty much only syntax differences (very few minor exceptions to this rule), which makes it a lot easier to translate between them conceptually than for any other arbitrary pairing of different programming languages -- even quite similar ones like C# and Java.

Dan Tao
+64  A: 

If you use VB.NET, it is almost a requirement to be able to read C#, because of the amount of information on the web that is written in C#. The reverse is very much less useful.

Henk Holterman
I would highly agree on this one...I've been using Java and C# for like...close to 10 years now, I've never learned VB(.NET) and I have never had a use for it except reading random examples in some places.
cyberzed
I'm a programmer with almost 6 years of VB.Net experience and is really common to find examples and documentation only in C# so reading to read C# is of great help. No need to go in deep of the language, just the basics to follow the execution flow.
SoMoS
+1 almost exactly what I wrote, and completely and utterly true.
Jack Marchetti
I would note that VB does offer a couple of things that C# doesn't that one should be aware of. Namely optional arguments, and XML literals. XML literals in VB are a pretty compelling reason to use VB for anything dealing with XML processing, though not nearly as nice as E4X imho.
Tracker1
@Tracker1 - As of March 22, C# has optional arguments too.
Joel Mueller
@Joel: VS2010 is postponed to April.
Henk Holterman
@Joel v4 isn't out until April (for RTM), and even so v2 through 3.5 code bases will linger for a couple more years in corporate settings.
Tracker1
@Tracker - The C# 4 compiler can target .NET 2.0, and optional parameters have always been supported in the CLR, so there's no reason at all you can't use C# optional parameters in a v2 codebase, provided you have VS 2010 or are willing to compile from the command-line.
Joel Mueller
@Joel, and for those of us *NOT* using a *BETA* application in a production environment? The build target matters less... There are plenty of companies out there that will not allow the update to vs2010 for a while, or deploying .Net 4 to dev machines for that matter. I happen to be working at a large bank, and am moderately restricted in this area. I know many other people that are as well.
Tracker1
@Tracker1 - What I'm trying to say is that as of April, it will be technically possible to build .NET 2 apps with C# 4, taking advantage of C# optional parameters. Such apps can be deployed to .NET 2 machines that have *never seen* .NET 4. Doing so will require either VS 2010 or the .NET 4 SDK on the dev machine. Whether or not doing so is allowed or advisable at a particular place is not related to the question of whether VB can still claim optional parameters as a feature it has but C# does not have.
Joel Mueller
@Joel, and what I am saying is that even after VS2010 is available, doesn't mean we can all install it to our work desktops.
Tracker1
+1 I started my career as a VB6 and then VB.NET Programmer. Later I had to do C# projects and now I'm more experienced on C# and since I've not coded VB.NET from years, I've to read small VB.NET examples on internet with extreme concentration which many a times recalls me "Oh! I used to use this syntax a lot."
Ismail
+1  A: 

It's certainly handy from the perspective of online help and tutorials to at least be able to understand what is hapening with code in "the other language"...

Personally, I prefer C# but use VB.Net as well - not because I want to, but because anythign that ends up going near the office has to be in VB.Net as that is the agreed .Net language we use...

Martin Milan
+1  A: 

I started with VB3 all the way to .NET before switching to C#. The "importance" is subjective, as it depends on what you work on. Plenty of companies use VB.NET and look for VB.NET Developers. I personally prefer C#. If you have to choose between the two, I always find Microsoft's comments on each of the targeted audiences for VB and C#:

Microsoft® Visual Basic® 2008 Express Edition is ideal for the developer learning to program on Microsoft® Windows®.

Microsoft® Visual C#® 2008 Express Edition offers a greater combination of power and productive for Windows developers building on .NET.

Microsoft Express Visual Studio

NebuSoft
Well, I can't even parse the second sentence from the link, but I think I know what it's trying to say. How curly brackets, colons and semi-colons offer greater power and 'productive' I'm not quite sure.
Jules
I think it is more about the focus for language design from microsoft's standpoint. They design VB to be focused towards a less experienced developer, where as they try to push C# as more of a "real development language." Again, it's moot because you can do powerful things in both languages and it all turns into bytecode anyway :D I'd assume the statement is more for marketing than anything.
NebuSoft
+3  A: 

C# is significantly more marketable, a quick check on JobServe shows that there are currently 1702 jobs being advertised mentioning C# and only 344 mentioning VB.Net.

I know of companies that have taken C# devs to work on VB.Net, but not the other way round.

amelvin
-1 - I was a vb.net developer and was given C# work. I then learned C#. Please people do not make it sound like C# (although I am now a C# programmer) is so much more better then VB.net cause it really isn't. You should use what you are comfortable with, but to state that there are no vb.net coders who took on C# assignments is really misleading.
JonH
I don't think amelvin is saying that. He's saying there is a perception that C# is "more serious" than VB.Net. This comes from the old VBx V's C++ dichotomy, which did tend to be true. I'm proficient in both C# and VB.net, it can be argued that C# can be *slightly* more powerful than .net, but there is very *very* little in the difference. We write plenty of "serious" realy world code in VB.Net
Binary Worrier
@JonH, it's more of the stigma that tends to be attached to VB developers, and VB as a toy language, though in the .Net space, and even from VB5-6 it hasn't been very true. Perceptions are long lived though. For the most part it isn't very hard at all to know both, though you may find some hold over syntax from people who know VB prior to .Net
Tracker1
Just being honest really, not having a go at VB.Net. I really believe that decent programmers can work in any language given the chance so VB.Net guys can move to C# and vice versa. But employers want more C# coders (that's not in question) and that I, personally, know of VB.Net shops that have been happy to convert C# coders - but I don't know of any C# shops that have been happy to convert VB.Net coders. There will be some - but I don't know of any.
amelvin
@JonH - amelvin did not say no vb.net coders who took on C#, but he was not aware of any. He did not simply say C# is better than vb.net, but more marketable (with basis). Disagreement is not a reason to mark the question down or to say this was misleading...it wasn't, it was simply stating facts.
Russell
@Russell - It is community wiki
JonH
+10  A: 

I used to use both VB.NET and C#. Now I'm writing all new code in C# but still have to maintain some older projects that use VB.NET. I find it fairly easy to switch between the two as the .NET library is largely the same in both. There are a few differences but if you are fluent in one, working in the other isn't too difficult. It's just a matter of knowing the differences and adjusting. It usually takes me a few minutes to make the switch to VB.NET as I keep trying to put curly braces and semi-colons everywhere but after a little while my brain makes the switch. Focus on one language and just know that working in the other will take a bit more time.

TLiebe
+1 The same for me! Curly braces everywhere, colons for inheritance,etc. Then, when back to C# after a while in VBNET, I forget semicolons, I try to declare variable with Dim... lol Thanks for the laughs!
Will Marcouiller
same here...just had to make some updates to an old asp 1.1 vb.net project. Oh the horror of VS 2003!
dotjoe
A: 

Its the .NET Framework, not the language.

Kris Krause
+6  A: 

If you are a VB programmer, I think it's almost crucial that you know C# because there are a lot more C# jobs out there than VB. And there is still the stigma attached to VB programmers, even if it is unfounded.

If you are a C# programmer, there is no reason at all to know VB. You will almost NEVER be asked to convert a C# application to VB, at least I've never heard of such things.

Jack Marchetti
I've recently had to convert a whole class from C# to VB.NET. in order to fit it in the VB.NET solution, tearing both versions appart and keeping both of them maintainable in it's solution. Yes, it was painful, but i've learned a lot =) now I feel comfortable on both, just takes a few moments to switch my brain.
MarceloRamires
I've come across many projects/clients who want their VB apps converted to C# but never the other way around. The main reason is that there are a lot more C# prorammers than VB, and they were having a problem attracting talent.
Jack Marchetti
@Jack: I think it's probably common to be *maintaining* an existing VB.NET application, where you have to fix bugs or add small features as well. This requires writing code, which, as I mentioned in a comment above, is more demanding than simply reading/interpreting code.
Jon Seigel
True, but in my experience as a consultant, the case is usually that the company has been maintaining a VB application, but they can't seem to find enough VB programmers. So they make the busienss decision to convert it to C#
Jack Marchetti
+5  A: 

I would say that a working knowledge of the differences between your language of choice, and the "other .NET languages" is important, especially if you are doing any project based work or consulting work.

I can't tell you how many times as a C# programmer I had the possibility to go to a client that was only a "VB House", and only wanted to see people who had "VB.NET" experience, no matter how good they were in C# and .NET in general.

This is mostly an educational issue with technical recruiters and HR people, who don't understand how .NET works, and the fact that a C# person can easily integrate into a VB House, and vice versa.

Having a working knowledge with project background (even if minor) that you can place on your resume goes a long way to opening doors to clients or projects that might normally have rejected you for that one stupid reason.

Nick
+2  A: 

These days, I am primarily a C# programmer, but recently I had to deal with (and modify) a bunch of VB.Net code. Rather than learn the ins and outs of the VB.Net syntax, I used this online code converter:

http://www.developerfusion.com/tools/convert/vb-to-csharp/

  • for the cases where I needed something that was a little unwieldy in VB.Net. In those cases, I'd code what I needed in C# and use the converter to get VB.Net. In most cases it worked well, and it avoided me having to pollute my brain with too much VB.Net.

Note that Reflector can also do similar conversions, but the online converter was simpler to use because it would convert snippets of code.

Andrew Rollings
+1  A: 

It's an important indictator of your ability. If you say you know C# really well, then you should have no problem understanding VB.NET; if you do, that means you really don't understand general programming concepts as well as you should. Especially since VB and C# really are very similar (aside from certain special features, which the C# and VB.NET teams have decided to "co-evolve"; instead of having different features, they will always have the same set of features, just implemented differently, at least that's the current plan as stated by the VB and C# team(s)).

As a programmer you should be able to learn new languages, ever faster and easier.

Richard Hein
+1  A: 

I think it's a matter of looking at the easy win - learning the syntax for the other language is not so hard, and it's an easy addition to what you are able to do when looking for a job. I think that there are a number of houses that have gone the route of 'classic' ASP > VB.net and then decided that C# is more pleasant and thus have a variety of projects in different languages.

Being able to dip in and out of whatever .net language is required of you when asked to maintain something is a useful thing to be able to do (although when you start writing If... Then and then trying to close it with a curly brace, you might be switching around too much).

Paddy
+3  A: 

My experience has been that recruiters and HR people are thick when it comes to understanding the differences between VB.NET and C#. If you say you know C# and not VB.NET and their job requirement is VB.NET, they'll pass you over.

For the purposes of actual job performance, what matters is knowing the framework. Knowing the syntax of Javascript gets you no where if you don't know the DOM. So, in my experience if you know one you can easily learn the other. I've hired smart VB.NET only developers on C# jobs and they have been able to quickly adapt. In a way, it is harder for C# people to adapt to VB.NET because VB.NET went off the reservation with key concept terminology (Shared instead of Static, MustInherit instead of Abstract etc.)

Thomas
+2  A: 

A good programmer can switch back and forth and pick up the core of a new language and start coding in it after a day and will learn the majority of its features quickly. With .Net and C# the only real difference is the syntax. They both use the same framework.

Knowing a language does not mean you know how to program. I may know English, but that doesn't mean I can write a play like Shakespeare.

Chad
+4  A: 

You should be fluent in a lot of languages, not only c# and vb.net. Sticking to one language or two will be bad for your career.

You should diversify your knowledge. C#, Java, Python, Ruby, Objective-C, AS3 at least.

JeremySpouken
Could you please expand on this thought? Why those languages in particular?
Jon Seigel
@jon diegel +1, could you elaborate why all of these, and why not others ?
MarceloRamires
These are the languages that are on demand right now, you can just go and check available developer positions in monster.com, careerbuilder.com, etc... one position that's hot right now is FrontEnd Engineer where you have to be fluent in HTML, CSS and Javascript. I forgot to include PHP which is both hated and loved by developers all around. And it's easy to learn.And you should know your SQL / T-SQL this is very important.
JeremySpouken
+1  A: 

Not very :)

You can specialize in either of the two, and have plenty of work.

Alex Baranosky
+1  A: 

Even if you only code in one you should be able to read code in both. If you can't that tells something about your ability (or inability).

marko
+4  A: 

Being able to read VBNET is one thing. Being able to read C# is one other thing. Being able to know the difference between what is doable in C# and not in VBNET and vice-versa, is THE thing.

I'm a C# programmer with Assembler, C/C++ background and about 8 years of experience, and I have already used VB6 a little, enough to be able to debug code, etc. So VB syntax is nothing new to me.

However, when you know how to do something in C# using the lambda expressions, the predicates, etc. and try to bring this with you in VBNET, you might get a hard time trying what VBNET ends not offering at all.

The .NET Framework makes it easier in our situation since we're always talking .NET, the objects are the same, they do the same, and they all have the same behaviour. However, when using Linq and the .NET 3.5 features, you need to know for instance that VBNET doesn't support lambdas which don't return a value, you need to pass in the AddressOf Sub in order to do the same.

But that said, once you understand what you're doing in .NET, one may grow fluent in both easily enough to be at ease in C# and VBNET. Thus, you perhaps need to know that Microsoft's .NET façade language is C#. They tend to bring some more features in VBNET2010 from C# 4.0 so that these differences are no longer a matter of choosing C# against VBNET. Let's hope they succeed! =)

Will Marcouiller
A: 

I wouldn't worry about ti too much. Becasue of the similarities in the semantics of the two languages, if you're fluent in one of them you are already 90% of the way there in the other one.

Jeff Hornby
+1  A: 

I think its important to know both, looks better on a resume. I think if you learn C# first and then learn VB.NET its easier than going the other way. VB.NET lets you get away with a lot of stuff that C# doesn't put up with. I prefer C#, especially if you are working with JavaScript a lot since the syntax is similiar.

BrianK
+1  A: 

Both are complimentry to each other and so it is always good to have knowledge on both but again it is not an requirement that to understand C# you need to know VB.net but yes having knowledge of VB.net would always help you to understand C# better.

Rachel
+1  A: 

One thing missed in all these answers is that VB .NET is the macro language in Visual Studio. If you can't write VB .NET, you can't write Visual Studio macros to automate common tasks.

Kyralessa