The first version of C# was developed by Microsoft between 1999 and 2002 and was officially released to the public in 2002 as a part of the .NET platform. The .NET platform aims to make software development for Windows easier by providing a new quality approach to programming, based on the concepts of the “virtual machine” and “managed code”. At that time the Java language and platform reaped an enormous success in all fields of software development; C# and .NET were Microsoft’s natural response to the Java technology.
The C# Language
C# is a modern, general-purpose, object-oriented, high-level programming language. Its syntax is similar to that of C and C++ but many features of those languages are not supported in C# in order to simplify the language, which makes programming easier.
The C# programs consist of one or several files with a .cs extension, which contain definitions of classes and other types. These files are compiled by the C# compiler (csc) to executable code and as a result assemblies are created, which are files with the same name but with a different extension (.exe or .dll). For example, if we compile HelloCSharp.cs, we will get a file with the name HelloCSharp.exe (some additional files will be created as well, but we will not discuss them at the moment).
We can run the compiled code like any other program on our computer (by double clicking it). If we try to execute the compiled C# code (for example HelloCSharp.exe) on a computer that does not have the .NET Framework, we will receive an error message.
Keywords.
Independence from the Environment and the Programming Language
Microsoft Intermediate Language (MSIL)
The idea for independence from the environment has been set in the earliest stages of creation of the .NET platform and is implemented with the help of a little trick. The output code is not compiled to instructions for a specific microprocessor and does not use the features of a specific operating system; it is compiled to the so called Microsoft Intermediate Language (MSIL). This MSIL is not directly executed by the microprocessor but from a virtual environment called Common Language Runtime (CLR).