开发者

What are the differences and similarities between the .NET languages?

I'm trying to figure out how much overlap there is between the different languages of the .NET framework, an开发者_运维问答d 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?


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


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


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.


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.


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"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜