views:

115

answers:

5

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?

+1  A: 

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

FrustratedWithFormsDesigner
Anonymous methods are one example.
Anon.
Oh, there are several, such as unsafe code, varargs etc.
Lucero
(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
@Johannes: Good point(s)!
FrustratedWithFormsDesigner
A: 

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.

Leonidas
+3  A: 

There's a list of differences that claims to be complete here. And wikipedia has a page comparing them.

JeffH
That's a great list, but it looks like it was last updated in 2005. Any significant differences since then?
FrustratedWithFormsDesigner
A: 

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.

ChrisF
A: 

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"

Max Strini