Chapter 4. Language Interoperability Gotchas


The .NET Common Language Runtime (CLR) executes the Microsoft Intermediate Language (MSIL). Code written in one of .NET's various supported languages is translated into MSIL and metadata. Your compiled classes are referenced through metadata and used in this MSIL. This makes it possible to use code written in different languages. You can aggregate or associate an object of a class written in C#, for instance, within a VB.NET program. You can even inherit from a class written in a different language.

The exciting implication of this is that .NET does not restrict you to any language. If you are a C++ or Java programmer, you can use C# (or managed C++). If you are a VB programmer, you can use VB.NET. Or you can use one of the other 25+ languages supported in .NET. (Refer to "Languages available in .NET" in the section "on the web" in Appendix)

However, there are a few glitches to keep in mind. Not all the languages support every MSIL feature. Furthermore, each language has its own set of keywords; although there are some commonalities in keywords between languages, there are many differences to watch out for. What kind of mess can you get into with these differences? What are the things you need to remember to make your code interoperable between languages? These issues are the focus of this chapter.



    .NET Gotachas
    .NET Gotachas
    ISBN: N/A
    EAN: N/A
    Year: 2005
    Pages: 126

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net