3

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?

animuson
  • 50,765
  • 27
  • 132
  • 142
froadie
  • 71,770
  • 69
  • 154
  • 228
  • 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 Answers5

3

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

JeffH
  • 9,578
  • 2
  • 24
  • 47
1

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
  • 25,116
  • 30
  • 128
  • 188
  • Anonymous methods are one example. – Anon. Feb 03 '10 at 21:32
  • 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
0

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.

Community
  • 1
  • 1
Leonidas
  • 2,344
  • 14
  • 21
0

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
  • 127,439
  • 29
  • 243
  • 315
0

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
  • 2,258
  • 20
  • 22