Encyclopedia > C Sharp programming language

  Article Content

C Sharp programming language

C# (pronounced "see sharp") is an object-oriented programming language developed by Microsoft Corporation as part of their .NET initiative.

Microsoft based C# on C++ and the Java programming language. Such languages sacrifice RAD (Rapid Application Development) conveniences for power and low-level control. C# was designed as balance between power and development speed.

Unlike languages such as C and C++, C# does not compile to binary code, which can be executed directly by the target computer. Instead all .NET languages (which includes Visual Basic .NET and Managed C++ as well as C#) compile to something Microsoft calls MSIL. To the casual observer, the resulting program looks like a normal executable and has an ".exe" extension just like a normal application. However the .NET program actually consists of an intermediate language. When the program is executed, the .NET framework JITs the intermediate code into machine language as it is run. The JITting is very fast and is not noticeable on most modern PCs. As different parts of the program are used, they are JITted. Once JITted, that portion of the program does not need to be JITted again for that run (the program will use the JITted version). Each time a .NET application is run, it needs to be JITted in this fashion. Because the .NET applications require this JITting, only computers with the .NET framework can run .NET applications.

Microsoft has submitted C# to the ECMA for formal standardization. In December 2001, ECMA released ECMA-334 C# Language Specification. There are independent implementations being worked on, including:

More recently, Microsoft has announced plans to add support for generics, partial types and some other new features. Cynics might suggest that this is Microsoft's first step to embrace, extend and extinguish the standard as they have done with other standards before. It will be interesting to see whether these new features are likewise submitted for standardisation.

Example

 using System;

 namespace Example {

     public class HelloWorld {

         private String aString;

         public HelloWorld() {
             aString = "Hello World";
         }

         public override String ToString() {
             return(aString);
         }

         public static void Main() {
             HelloWorld aHelloWorld = new HelloWorld();
             Console.WriteLine(aHelloWorld.ToString());
         }
         //Output is:Hello World
     }
 }

See also: F sharp programming language

External Links



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Johann Karl Friedrich Rosenkranz

... midway between Erdmann and Gabler on the one hand, and the "extreme left" represented by Strauss, Feuerbach and Bruno Bauer. Of his numerous writings, the following ...

 
 
 
This page was created in 22.7 ms