<style> .reveal-up, .reveal-left, .reveal-right, .reveal-stagger > * { opacity: 1 !important; transform: none !important; } </style>
  1. Learn
  2. C#
  3. Getting started
All lessons in this course

Lesson 1 of 60 8 minBeginner

What is C# and .NET?

Before writing code, understand what C# is, what .NET does for you, and how your text file becomes a running program.

A computer’s processor only understands machine code: long lists of numbers. Writing that by hand is almost impossible, so we write in a programming language that people can read, and a tool translates it for the machine. C# (pronounced “C sharp”) is one of those languages.

C# in one paragraph

C# was created by Microsoft in 2000 and is now open source. It is a general-purpose, strongly typed, object-oriented language. In simple words: you can build almost anything with it, every value has a clear type (number, text, true/false…), and you organise code into objects that model real things.

You can build…With…
Windows desktop appsWPF, WinForms, WinUI
Websites and web APIsASP.NET Core
Mobile apps.NET MAUI
GamesUnity
Engineering / BIM / 3D software.NET with libraries like VTK, Revit and Tekla APIs
Cloud services and toolsAzure, console apps, background services

C# vs .NET: what is the difference?

Freshers often mix these up. C# is the language (the grammar and words you write). .NET is the platform that compiles and runs your C# code. .NET gives you three big things:

  • A compiler that checks and translates your code.
  • A runtime (the CLR) that runs your program and manages memory automatically.
  • A huge class library: ready-made code for files, text, maths, networking, dates and much more, so you don’t write everything yourself.

How your code runs

C# goes through two translation steps. First at build time, then again when the program runs. Step through the diagram:

Interactive

From your code to a running program

Press Play, or click any step to see what happens there.

Step 1 of 5 · Build time
Your C# code

You write instructions in plain text files that end in .cs. Humans can read this, but the computer cannot run it directly.

Why two steps? IL is the same on every computer, so one .dll can run anywhere .NET is installed. The JIT then produces machine code tuned for the exact CPU it is running on.

Words to know

TermMeaning
Source codeThe C# text you write, saved in .cs files.
CompilerThe tool that checks your code and translates it to IL.
ILIntermediate Language: CPU-independent instructions.
AssemblyThe .dll or .exe file that contains IL.
CLRCommon Language Runtime: runs your program, manages memory.
JITJust-In-Time compiler: turns IL into machine code while running.
Garbage collectorPart of the CLR that frees memory you no longer use.
SDKSoftware Development Kit: everything needed to build .NET apps.
Quick check

Which part turns IL into machine code for your CPU?

Quick check

Is C# the same thing as .NET?

Remember

  • C# is a strongly typed, object-oriented, general-purpose language.
  • .NET is the platform: compiler + runtime (CLR) + class library.
  • Build time: C# → IL in a .dll. Run time: the JIT turns IL into machine code.
  • The garbage collector frees unused memory for you.
0 of 60 lessons completed