Introduction of C#.Net

With the introduction of the .NET framework, Microsoft included a new language called C# (pronounced C Sharp). C# is designed to be a simple, modern, general-purpose, object-oriented programming language, borrowing key concepts from several other languages, most notably Java.
C# could theoretically be compiled to machine code, but in real life, it’s always used in combination with the .NET framework. Therefore, applications written in C#, requires the .NET framework to be installed on the computer running the application. While the .NET framework makes it possible to use a wide range of languages, C# is sometimes referred to as THE .NET language, perhaps because it was designed together with the framework.
C# is an Object Oriented language and does not offer global variables or functions. Everything is wrapped in classes, even simple types like int and string, which inherits from the System.Object class.C# can be written with any text editor, like Windows Notepad, and then compiled with the C# Command line compiler, csc.exe, which comes with the .NET framework. However, most people prefer to use an IDE (Integrated Development Environment), and Microsoft offers several options for this. Their flagship is Visual Studio, which can be used to work on every possible aspect of the .NET framework. This product is very advanced, and comes in several editions. Visual Studio is not exactly cheap, and might even be too advanced for hobby programmers.
With .NET framework 2.0, Microsoft introduced the so-called Express versions, targeted at hobby programmers and people wanting to try .NET, and they continued this tradition with the later release of .NET 3.0 and 3.5. The Express versions onlywork for one language, like C# or VB.NET, and miss some of the really advanced features of Visual Studio.
C# Hello World Example
A C# program basically consists of the following parts:
• Namespace declaration
• A class
• Class methods
• Class attributes
• A Main method
• Statements & Expressions
• Comments
Let us look at a simple code that would print the words “Hello World”:
usingSystem;
namespaceHelloWorldApplication
{
classHelloWorld
{
staticvoidMain(string[]args)
{
/* my first program in C# */
Console.WriteLine(“Hello World”);
Console.ReadKey();
}
}
}

Alisaba Anwar

Mother of two and passionate as a content writer; writing is my enthusiasm. Spare time spent in kitchen and busy time on computer desk :)

Leave a Reply

Your email address will not be published.