tags:

views:

135

answers:

6

Possible Duplicate:
Should I learn VB.NET or C#?

There are a lot of new .NET developers starting careers or school with little to no previous programming experience, or programmers moving from other languages like Perl.

Which .NET language would be the best for new developers to learn in to give them the best learning curve?

A: 

C#. Most .NET jobs require it. All the examples on the Internet use it. And it doesn't have the stigma attached to it that VB does (it's a good language, but VB 6 was painful).

Samir Talwar
Stigma schmigma.
Konrad Rudolph
"Most .Net jobs require it" - Microsoft said in mid-2009 there are slightly more VB.Net programmers than C#. http://stackoverflow.com/questions/783631/will-vb-net-be-phased-out/1340951#1340951
MarkJ
@MarkJ: purely anecdotally, I see a lot more C# jobs out there than I do VB ones. Perhaps it's location-oriented?
Samir Talwar
A: 

I find C# to be the language to learn, C# is also very "close" related to Java which is kind a nice.

Marthin
+3  A: 

Technically speaking, there is no reason for choosing VB.NET or C#, because the languages are pretty much equivalent (I know of one advanced feature that's not available in VB.NET, but is available in C# and that's iterators). The languages are so similar, so you won't have any trouble learning the other one. The key thing is that you'll learn .NET and .NET libraries.

So, I'd really make a choice based on what your colleagues/friends use and on what good books/resources are available for learning.

  • If you have colleagues or friends who are using C#/VB.NET, then use the same language so that you can discuss the topic with them. That's IMHO the best way to learn.
  • If you find some good beginner book for C#/VB.NET then choose the language used there. You can learn the other language quite easily, but understanding .NET and learning .NET libraries is the difficult thing.
Tomas Petricek
+1  A: 

C# was designed from scratch to target the CLI. It has some extra features that VB doesn't have - a couple that spring to mind are interface inheritance and optional unchecked integer arithmetic.

VB has a more readable syntax and the IDE gives you more typing help by default. I personally find all the curly braces of C# something of a nuisance, but in my view the framework your language targets is much more a measure of usefulness thah the language syntax itself - and both VB and C# target the CLI.

Given the fact you have to make a choice at some point, I'd narrowly agree with the people saying go for C#, but IMO it isn't a critical decision.

Tom W
Nonsense. VB does have interface inheritance (why shouldn’t it?!?) and unchecked integer arithmetic *can* actually be enabled in the optimizations. In fact, VB has almost all features of C# (real exceptions are a syntax for pointers – although the same can be achieved using framework methods, and iterator blocks, i.e. `yield`), and some that C# doesn’t have (such as `MyClass` calling, more powerful `switch` facilities …).
Konrad Rudolph
[VB: Dim myString As String; // verbose storyland syntax][C# string mystring; // just gets on with it]By learning C# you'll be able to understand code segments from many other languages... VB.NET verbose syntax will just leave you confused when you look at code from other languages.The above example demonstrates just how much babble goes into VB.NET, with c# its just to the point - and as a plus C# developers tend to earn higher salaries than vb.net programmers for code which is part of the same family!
Dal
Fair point on the interfaces. I misread this documentation http://msdn.microsoft.com/en-us/library/h9xt0sdd.aspx . I thought I remembered checking it out and seeing that it indeed didn't work. Having just checked again, I was mistaken.With regards to the checked arithmetic, wouldn't that be an IL feature rather than a language one? It appears on inspection to be a VB compiler option, in which case it isn't strictly part of the *language*, rather the *implementation*. I'm still not aware of a VB language element that instructs the compiler to perform an unchecked IL expression.
Tom W
@Dal: Technically, the VB way of declarations is superior since the `Dim`/`Function`/whatever introduces what comes after. In C#, no keyword introduces the declaration, we just get a type name followed by an identifier. I fail to see how the verbosity hurts in this situation.
Konrad Rudolph
@Tom W: Well, in .NET the language doesn’t simply mean the code files, it *always* also includes the configuration. Personally, I think that’s bad but it’s not a VB-only problem, the same is true for C# – in fact, the `-checked` command line flag does the same for C#, only that the default value is the opposite from VB’s. Or consider the `unsafe` command line option.
Konrad Rudolph
@Konrad: if your new to programming then it might be useful, but over time repeating the Dim statement all the time become pointless in my opinion, you know what your doing - ie. you want to create a variable of some type, I just find VB.NET syntax muddy. I was forced to use the language for 6 months until I could rewrite it all in C#, hated everyday of using it - to be fair it does what C# can do of course (.NET) but I prefer C# syntax.
Dal
A: 

Just like Marthin said, c# syntax is very similar to java and I think that is one good reason to choose c# instead of vb.

I really can't see any advantages that vb have in comparison with c#.

Nordis
A: 

I agree that C# is one of the best languages to learn in terms of it's practicality in the workplace. However, I believe that VB.net is one of the best languages to start with - particularly because of its intuitive, easy-to-read syntax. That way, you can learn how to program instead of trying to struggle through potentially confusing syntax while taking your first baby steps.

However, for new developers that already have programming experience, I couldn't recommend C# more.

Thanks, Tyler

Tyler Murry