Home SEO Tools HTML Escape Tool Character Counter Guest post

Introduction to CSharp (C#) Programming Tutorial

0 comments


C#

In this part of the C# tutorial, we will introduce the C# programming language.

Goal

The goal of this tutorial is to get you started with the C# programming language. The tutorial covers the core of the C# language. Variables, arrays, control structures and other core features. It is not a complete coverage of the language. It is a quick, introductory material. This tutorial uses command line compilers to build applications. It does not cover graphical interface development, or visual IDEs. This tutorial focuses on the C# language; everything else is considered a distraction.

C#

C# is a modern, high-level, general-purpose, object-oriented programming language. It is the principal language of the .NET framework. The design goals of the language were software robustness, durability and programmer productivity. It can be used to create console applications, GUI applications, web applications, both on PCs or embedded systems. It is a very popular language. Currently, it is one of the top 10 popular languages in the world. It was created on the Windows platform. The Mono project has created a clone for the Linux and Mac platforms. C# is a compiled language. The source code is compiled into executable (.exe) files, which are executed by the .NET platform.

Programming languages

There are currently several widely used programming languages. The following list is based on the TIOBE Programming Community Index. The numbers are from August 2010. Note that these figures are only illustrative.
PositionLanguageRatings
1Java18%
2C17.9%
3C++9.7%
4PHP9.2%
5Visual Basic5.4%
6C#5%
7Python4.2%
8Perl3.4%
9Objective C3.2%
10Delphi2.4%
Java is the most widely used programming language. Java excels in creating portable mobile applications, programming various appliances and in creating enterprise applications. Every fourth application is programmed in C/C++. They are mainly used for creating operating systems and various desktop applications. C/C++ are the most widely used system programming languages. Most famous desktop applications were created in C++. May it be MS Office, Macromedia Flash, Adobe Photoshop or 3D Max. These two languages also dominate the game programming business.
PHP dominates over the Web. While Java is used mainly by large organizations, PHP is used by smaller companies and individuals.
Visual Basic represents the popularity of rapid application development and the dominance of Microsoft.
The C# was planned to be the next big language. It should compete mainly with Java and C/C++ languages.
Python and PERL are popular scripting languages and close competitors.
The popularity of the Objective C stems from Mac and their innovative appliances.
Deplhi is a popular RAD development tool.

Compiling

There are two prominent C# compilers. The Microsoft C# compiler and the Mono C# compiler.
Linux On Linux, we need to install the Mono C# compiler. It is called gmcs for C# 3.0 profile and dmcsfor the C# 4.0 profile. To install the Mono C# compiler, we must install the Mono platform.
$ gmcs simple.cs
$ ./simple.exe
This is C#
We compile and run a simple C# program on Linux.

Windows On Windows, we have two basic options. Either use the command line compiler or use some version of the Visual Studio. The .NET framework is already installed on many versions of Windows OS. If not, we download it and install it from the microsoft.com website.
On my system, the .NET framework was installed on C:\WINDOWS\Microsoft.NET\Framework\v3.5. Here we find the csc.exe file, which is a compiler of the C# language.
C:\programming\csharp>C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe simple.cs
C:\programming\csharp>simple.exe
This is C#
We compile and run a simple C# program on Windows.
Another option is to use e.g. Visual Studio C# Express Edition. We create a new project. Select File/New Project or click Ctrl+N. Select Console application.

Console application
Figure: Console application

To run an example, click Ctrl + F5.

Sources

The following sources were used to create this tutorial:
In this part of the C# tutorial, we have introduced the C# language.

Do you like this Tutorial? Please link back to this article by copying one of the codes below.

URL: HTML link code: BB (forum) link code:

No comments:

FAQs | Privacy Policy | Contact | | Advertise | Donate