6.2.1 The C# Language Specification an Overview
C# was introduced by Microsoft in 2000 as the premier language for writing .Net applications in
the enterprise computing space , as Microsoft puts it. C# derives from C and C++. However, it
modernizes C++ in the area of classes, namespaces, method overloading, and exception
handling. Certain features, such as macros, templates, and multiple inheritance have been
eliminated from the language, to make its use easier and less error prone. C# is clearly
Microsoft's answer to Java (Sun prevented Microsoft from integrating Microsoft's Java
implementation Visual J++ more closely to the Windows environment through a lawsuit). The
resemblance to Java is very strong; however, Microsoft tries to offer an even more powerful
language to the web application programmer under the Windows platform. Java and C# are
compared in detail in Chapter 6.2.3.
6.2.2 The .NET Common Language Runtime (CLR)
Microsoft recognized the advantages of Sun Microsystems' approach of generating so called
byte code , the platform independent semi compiled code that is generated by the Java
Compiler (javac) and executed through the Java Virtual Machine (JVM). Microsoft's version of
this technology is implemented as the Common Language Runtime (CLR) within the .NET
platform. Similar to the Java platform, this runtime manages the execution of code via the Virtual
Execution System (VES), and it provides services that make programming easier and faster
(Rapid Application Development concepts). The managed code that is executed by the CLR is
called Intermediate Language (IL). C# is compiled to IL, but other programming languages,
such as Visual Basic or C++ can be compiled to IL as well. Programming is made easier
through automatic memory management (garbage collection), cross language integration
(including exception handling), and versioning support.
6.2.3 Comparison of Java and C#
Both C# and Java are languages that resemble C++ and C, but have cleaned up with some of
the less used (such as templates) or error prone (such as multiple inheritance) features of C++.
Following is a table that compares the two language's features in detail.