Certainly there's the difference in general syntax, but what other critical distinctions exist? There are some differences, right?
-
3I think the lack of a religious debate over the issue is an indication of just how similar they are. :) – EBGreen Aug 17 '08 at 17:55
14 Answers
The linked comparisons are very thorough, but as far as the main differences I would note the following:
C# has anonymous methodsVB has these now, tooC# has the yield keyword (iterator blocks)VB11 added this- VB supports implicit late binding (C# has explicit late binding now via the dynamic keyword)
- VB supports XML literals
- VB is case insensitive
- More out-of-the-box code snippets for VB
More out-of-the-box refactoring tools for C#Visual Studio 2015 now provides the same refactoring tools for both VB and C#.
In general the things MS focuses on for each vary, because the two languages are targeted at very different audiences. This blog post has a good summary of the target audiences. It is probably a good idea to determine which audience you are in, because it will determine what kind of tools you'll get from Microsoft.

- 18,585
- 24
- 87
- 110
-
2VB has anonymous functions, just so long as they return a value. There is no such thing as an anonymous method. A method, by definition, is a named function that implicitly takes an object reference. – Jonathan Allen Sep 09 '08 at 08:29
-
2
-
C# now also supports a form of late binding, through the `dynamic` keyword. This is still different from VB.Net: in VB you allow binding by turning 'Option Strict' on or off either at the project level or at the file level. In C#, the late binding support is more explicit (at the statement level), through the use of the `dynamic` keyword. – jeroenh Aug 26 '10 at 08:12
-
3VB.Net now has the [`Yield`](http://msdn.microsoft.com/en-us/library/vstudio/hh156729.aspx) keyword. See also http://stackoverflow.com/questions/97381/yield-in-vb-net – kodkod Dec 16 '12 at 16:33
-
As others have pointed out, VB also has the `Yield` keyword, it was added in VB 11. Also, C# supports implicit late binding as well through the `dynamic` type (since C# 4); it behaves like the `Object` type in VB with Option Strict Off. And, lastly, VS 2015 enables the same refactoring tools for both C# and VB. – andre_ss6 Feb 08 '15 at 02:44
-
Hey andre_ss6, I'm not sure why your edit got rejected, I wanted to accept it but 3 morons had already rejected it. I'm going to fix it myself now. – Luke Feb 11 '15 at 01:17
This may be considered syntax, but VB.NET is case insensitive while C# is case sensitive.

- 68,705
- 38
- 88
- 99
-
4Oh it's a feature allright. Go ahead, try debugging a pile of code where you have intcounter and intCounter being two different variables. There should be NO difference between the two. Case sensitivity is a leftover from days when computing power was far more expensive (and parsing a line where "A" <> "a" is quicker than figuring out they're really the same). – David Jun 04 '10 at 18:24
Since I assume you can google, I don't think a link to more sites is what you are looking for.
My answer: Choose base on the history of your developers. C# is more JAVA like, and probably C++ like. VB.NET was easier for VB programmers, but I guess that is no really an issue anymore sine there are no new .NET programmers coming from old VB.
My opinion is that VB is more productive then C#, it seems it is always ahead in terms of productivity tools (such as intelisense), and I would recommend vb over c# to someone that asks. Of course, someone that knows he prefers c# won't ask, and c# is probably the right choice for him.

- 4,053
- 3
- 32
- 42
Although the syntax sugar on C#3 has really pushed the bar forward, I must say some of the Linq to XML stuff in VB.Net seems quite nice and makes handling complex, deeply nested XML a little bit more tolerable. Just a little bit.
One glaring difference is in how they handle extension methods (Vb.Net actually allows something that C# doesn't - passing the type on which the extension method is being defined as ref): http://blog.gadodia.net/extension-methods-in-vbnet-and-c/

- 11,310
- 11
- 51
- 70
-
Too bad there's no warning if one tries to use such an extension method in a read-only context (the compiler copies the value and passes the copy as a `ref` parameter--grr). – supercat Jan 29 '13 at 23:50
Apart from syntax not that much any more. They both compile to exactly the same IL, so you can compile something as VB and reflect it into C#.
Most of the apparent differences are syntactic sugar. For instance VB appears to support dynamic types, but really they're just as static as C#'s - the VB compiler figures them out.
Visual Studio behaves differently with VB than with C# - it hides lots of functionality but adds background compiling (great for small projects, resource hogging for large ones) and better snippet support.
With more and more compiler 'magic' in C#3 VB.Net has really fallen behind. The only thing VB now has that C# doesn't is the handles
keyword - and that's of debatable benefit.
@Tom - that really useful, but a little out of date - VB.Net now supports XML docs too with '''
@Luke - VB.Net still doesn't have anon-methods, but does now support lambdas.

- 150,284
- 78
- 298
- 434
-
-
Ahh, yes, of course. VB supports inline XML - I'm still not sure of the benefit of mixing data and code like that. – Keith Sep 10 '08 at 06:43
This topic is briefly described at wikipedia and harding.
http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Visual_Basic_.NET http://www.harding.edu/fmccown/vbnet_csharp_comparison.html
Just go through and make your notes on that.

- 23
- 9
The biggest difference in my opinion is the ability to write unsafe code in C#.

- 12,668
- 3
- 36
- 53
Although VB.NET supports try...catch type exception handling, it still has something similar to VB6's ON ERROR. ON ERROR can be seriously abused, and in the vast majority of cases, try...catch is far better; but ON ERROR can be useful when handling COM time-out operations where the error can be trapped, decoded, and the final "try again" is a simple one line. You can do the same with try...catch but the code is a lot messier.

- 7,645
- 6
- 36
- 81
When it gets to IL its all just bits. That case insensitivity is just a precompiler pass. But the general consensus is, vb is more verbose. If you can write c# why not save your eyes and hands and write the smaller amount of code to do the same thing.

- 39,797
- 30
- 87
- 118
One glaring difference is in how they handle extension methods (Vb.Net actually allows something that C# doesn't - passing the type on which the extension method is being defined as ref): http://blog.gadodia.net/extension-methods-in-vbnet-and-c/

- 11,310
- 11
- 51
- 70
Yes VB.NET fixed most of the VB6 problems and made it a proper OOP language - ie. Similar in abilities to C#. AlthougnI tend to prefer C#, I do find the old VB ON ERROR construct useful for handling COM interop timeouts. Something to use wisely though - ON ERROR is easily abused!!

- 7,645
- 6
- 36
- 81