What is C#?

Hello everybody, we will tell you what is the language C# in this article. It's an object oriented programming language, and was created by Microsoft from 1998 to 2001 for the Microsoft .Net Framework platform. At this time, there are 5 versions of the C# language. The ASP.NET technology is written in this language, which is a very functional and popular. The name of the language received from the musical concept of Sharp, which enhances the sound of a semitone. Since the accurate display of the sign is not present on the keyboard, it was decided to replace it with a number "#" sign. The standardization of the C# language is held in the ISO and ECMA committees.

This language belongs to the family of C. The syntax is very similar to C++ and Java. Let us briefly tell you the historical aspects of all versions of the language. The first version had learned a lot from Java, such as the delegates, attributes, indexers, structures, and so on. And C# has taken a lot from the C++ language, what was not available in Java. Basically, the method with a variable number of parameters, operator overloading, unsigned types and more. In 2000, the language has been represented with the .NET platform and in 2002 its development was finished.

Version 2.0 was shown in 2003, its main innovations are the new form of an iterator, which can be created by using the keyword "yield". The opportunity to create stored procedures and triggers. There are resettable and partial value types. In 2005, a new version 3.0, which was the addition to .NET 2.0 and Visual Studio 2005. Language improvement was syntax and clearly shown at compile time. Version 3.0 is compatible with the previous one. Local variable "var" appeared, also anonymous types, extension methods and new keywords such as from, where and select were introduced.

Version 4.0 was created in 2008, and finally presented only in 2010 together with Visual Basic 10.0. New features were named and optional parameters, the use of late binding. The concepts of covariance and contra variance were created. Last 5th version is in development since August 2012.

Next, we will try to write a simple program in C # as a console application. As the development environment, we will use Visual Studio. For example, we take the 2008 version. Environment is created by Microsoft and is one from the product line that includes integrating development environment. Here you can easily create applications with a graphical user interface, and console applications. Also, it can help you to design web - sites and build web - applications. Microsoft Visual Studio includes integrated debugger, source code editor, elements to create a graphical user interface and more. This environment is intended to develop such types of applications: Visual C++, Visual Basic, Visual C#. It is also possible to work with other types of projects, such as Setup and Deployment, Database, Extensibility and Visual Studio Solutions.

So, open up the Visual Studio, choose File -> New -> Project in the program menu. Next, we will open the window shown in the figure, in which we click Other Languages -> Visual C# in the left pane. And choose application for the console, respectively on the right side, it's named Console Application.

Launching the project

Now, we will write the code for our program which will output "Good Day!" message in the console. After the user presses a key, the console window closes. Code of our program is as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
    class Program
        static void Main()
            Console.WriteLine("Good Day!"); // This text is displayed in the console
            Console.ReadKey(); // wait until user presses a key

Window of the project will look like this.


After we typed the code of our program, you can click Debug -> Start Debugging in the upper pane of the window, or you can find green triangle button on panel. Thus, we run the program as a console application. The result will appear in the console window, as shown in the figure.


To summarize, the C# language is very powerful in the modern times and is widely used for application development. In this article, we have shown all the innovations of all of its versions, and learned through the Visual Studio IDE how to create a program for the console command line.

Best regards, DYAMAR Engineering.


All rights reserved. You may not copy or distribute, electronically or otherwise, any part of this article for any purpose without prior written permission from the DYAMAR Engineering.