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 apps
WPF, WinForms, WinUI
Websites and web APIs
ASP.NET Core
Mobile apps
.NET MAUI
Games
Unity
Engineering / BIM / 3D software
.NET with libraries like VTK, Revit and Tekla APIs
Cloud services and tools
Azure, 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.
Build time (when you compile)Run time (when you start the app)
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
Term
Meaning
Source code
The C# text you write, saved in .cs files.
Compiler
The tool that checks your code and translates it to IL.