I'm trying to figure out how much overlap there is between the different languages of the .NET framework, and what the real differences are. Is there an overlap of libraries/methods/functions...? If I'm googling a question for, say, VB .NET, and C# answers come up, what can I take from the C#-relevant info and what differences/incompatibilities should I look out for?
-
Just one more point I'd like to know - if there's a method that works in VB .NET (e.g. format()), can I assume that it will work in C# also? And vice versa? Or is the syntax of the libraries different as well? – froadie Feb 03 '10 at 21:59
5 Answers
There's a list of differences that claims to be complete here. And wikipedia has a page comparing them.

- 10,254
- 2
- 27
- 48
-
That's a great list, but it looks like it was last updated in 2005. Any significant differences since then? – FrustratedWithFormsDesigner Feb 03 '10 at 21:35
In theory, it should only be a syntactic difference, since they all get boiled down to the same runtime language. In reality, there might be some features not implemented in all languages, but I don't actually know of any.
Might be more details here: http://support.microsoft.com/kb/308470

- 26,726
- 31
- 139
- 202
-
-
3(Nearly) only syntactic difference may be right for C#/VB but certainly not if you take other languages into account, such as F# that are a completely different paradigm. Using the CLR as an argument that there will be only syntactic differences is as if you would argue that *all* programming languages are just syntactic variants of each other because in the end they're executed as machine code on the CPU ... – Joey Feb 03 '10 at 21:35
Differences: some, for example the legacy-libraries for Visual Basic. See Hidden VB.Net-Features and Hidden C#.Net-Features for a nice compilation of unique things.
Overlap: Intermediate Language. There you'll find all .Net-Features combined and the languages are at this point all equal.
I know it's not directly answering your question, but there are various VB.NET <> C# translators freely available. So if you come across some code in C# (say) and you need it in VB.NET you could get it translated.
A search for "vb.net c# translator" yielded the following as the first few hits.
http://www.carlosag.net/Tools/CodeTranslator/
http://www.developerfusion.com/tools/convert/csharp-to-vb/
http://authors.aspalliance.com/aldotnet/examples/translate.aspx
A word of warning, like all machine translations the results should be double checked. However, having said that they might do a "good enough" job to get you started and over the initial hurdle.

- 134,786
- 31
- 255
- 325
C# vs. VB are very nearly semantically identical with fairly minor non-syntactic differences. F#, Powershell, Ruby and Python are rather different. F# is an interesting case: basically every C# feature maps to something in F# (sometimes in clever ways), but F# has its own features such as algebraic data types -- these do map to CLR constructs, but I'd class them as "semantic sugar" rather than "syntactic sugar"

- 2,288
- 21
- 24