Introduction to C# & .NET Tutorial

In this introductory tutorial we cover C# as a language. C# is used by Stackoverflow, Handbrake, Unity Game Engine and many more.

We will learn what C# is, what it's used for, and why you should learn this powerful programming language.

What is C# and .NET

C#, or C-Sharp, is a modern, general purpose, object oriented, programming language used to create programs across multiple platforms.

  • C# is a programming language
  • .NET is a framework for building applications on Windows

C# was developed in 2000 at Microsoft by Anders Hejlsberg and his team during the development of the .NET Framework. C# was intended to be an alternative to Java.

.NET is not limited to C#, there are different languages that make use of the .NET framework like F# or VB.NET.

What is the .NET framework

The .NET Framework consists of two components:

  • CLR (Common Language Runtime)
  • Class Library for building applications

The Common Language Runtime (CLR)

When the developers at Microsoft wrote C# and the .NET Framework, they borrowed an idea from the Java community.

When you compile Java, it’s not translated directly into machine code, instead it’s translated into an intermediate language called ByteCode before being translated into machine code. This makes it independent of the computer on which it’s running.

In C# we have the exact same concept, where code is translated into IL (Intermediate Language) Code first.

Translating IL Code into native code is the job of CLR and the process is called Just-In-Time compilation (JIT). As long as a system, such as Linux, has CLR, it will be able to run your application.

Why learn C#

  • C# is modern and efficient
  • C# is an easy-to-learn, structured language
  • C# can be compiled cross-platform
  • C# is part of the .NET Framework
  • C# is object and component oriented

C# has some strong programming features such as automatic garbage collection, simple multithreading, easy-to-use generics, and many more.

C# has been used to create programs like Handbrake, Paint.NET, KeePass, Stackoverflow etc. and is also used to create games with the Unity Engine.

C# and .NET is, in general, considered to be an Enterprise Level programming platform, and as such it’s usually used to create in-house programs for corporate clients.

Is C# hard to learn

Even though C# follows traditional high-level languages like C and C++, it has a strong resemblance to Java.

C# isn’t hard to learn, but it’s a complex language and may require more time to fully learn all its features.

Prerequisites

Before we proceed, please note that we make the following assumptions:

  • You know how to install software on whichever operating system you use.
  • You can create and navigate directories and files on your computer.

While this tutorial series is for beginners with no knowledge of C# or programming in general, programmers coming from other languages that want to learn C# will also find it very helpful.

This tutorial series covers many topics of programming in C#, ranging from beginner concepts to advanced.