Chapter 1: Introduction to C# and .NET

1. What is C#? (Simple & Clear Explanation)

C# (pronounced “C Sharp”) is a modern, powerful, and very popular programming language created by Microsoft.

Think of it like this:

  • C → is the grandfather (very old, powerful but tricky)
  • C++ → is the father (more features, but still complicated)
  • C# → is the cool, modern son — easier to use, safer, and does almost everything the parents can do (and more!)

C# was designed to be:

  • Object-oriented (we’ll talk about this a lot later — it’s super important!)
  • Type-safe (helps you avoid silly mistakes)
  • Simple yet powerful
  • Beautiful syntax (many developers say it’s one of the nicest-looking languages)

2. Brief History of C# (Just the Important Parts)

  • 2000 — Microsoft announces C# at the Professional Developers Conference (PDC). Anders Hejlsberg (the creator of Turbo Pascal & Delphi) leads the team.
  • 2002C# 1.0 is released together with .NET Framework 1.0. It was basic but already very good!
  • 2005C# 2.0 — Generics arrive (huge for performance and safety)
  • 2007C# 3.0 — LINQ (one of the biggest game-changers ever!)
  • 2010C# 4.0 — Dynamic typing, named & optional parameters
  • 2012C# 5.0async/await (made asynchronous programming beautiful)
  • 2017C# 7.0 — Tuples, pattern matching, local functions
  • 2019C# 8.0 — Nullable reference types, default interface methods
  • 2021C# 10 — Global using directives, file-scoped namespaces
  • 2022C# 11 — Raw string literals, required members
  • 2023C# 12 — Primary constructors, collection expressions
  • 2024C# 13 — Enhanced params collections, new lock object, partial properties, field keyword (preview in VS 17.12+)
  • 2025C# 14 — Released with .NET 10 (November 2025) — brings even more modern features like extension members, user-defined compound assignment operators, and more performance & productivity improvements

As of January 2026, the latest stable version is C# 14 (released with .NET 10 in November 2025). C# 14 is what most new projects should use today!

3. What is the .NET Ecosystem? (2026 Edition)

.NET is the platform (like the house) where C# (the language) lives and works.

Think of .NET as a big toolbox that gives C# all the power to:

  • Run fast
  • Work on Windows, macOS, Linux
  • Build web apps, mobile apps, desktop apps, games (Unity), cloud services, AI apps, IoT, etc.

Two Big Branches (Very Important!)

Feature .NET Framework (old) .NET (modern, recommended)
Release years 2002 – 2022 2016 – present (formerly .NET Core)
Cross-platform? Only Windows Windows + macOS + Linux + Android + iOS + Browser (WebAssembly)
Latest version (Jan 2026) 4.8.1 (still supported but no new features) .NET 10 (LTS – Long Term Support until Nov 2028)
Performance Good Much faster (AOT compilation, better GC, etc.)
Recommended for new projects? No Yes!

Current .NET Versions (as of January 2026)

Version Release Date Type Support Until Status
.NET 10 November 2025 LTS November 2028 Latest & Best
.NET 9 November 2024 STS November 2026 Active
.NET 8 November 2023 LTS November 2026 Active

Recommendation for 2026: Start new projects with .NET 10 + C# 14 (It’s the most modern, fastest, and supported for the longest time!)

4. Setting Up Your Environment (Step-by-Step – Super Detailed)

You have two excellent choices in 2026:

Option A: Visual Studio 2026 (Recommended for Beginners – Full Power)

  1. Go to: https://visualstudio.microsoft.com/downloads/
  2. Download Visual Studio 2026 Community (it’s free for individuals, students, open-source, small teams!)
  3. Run the installer
  4. In the workloads screen, select:
    • .NET desktop development
    • ASP.NET and web development (if you want web apps)
    • .NET Multi-platform App UI development (for mobile/desktop with .NET MAUI)
    • Game development with Unity (optional)
  5. Click Install (it will download ~5–10 GB depending on what you choose)
  6. After installation → Open Visual Studio → Create a new project → Choose Console App (.NET) → Select .NET 10.0 → Done!

Option B: Visual Studio Code + .NET SDK (Lightweight & Free Forever)

  1. Download & install Visual Studio Code: https://code.visualstudio.com/
  2. Install .NET 10 SDK:
    • Go to: https://dotnet.microsoft.com/en-us/download/dotnet/10.0
    • Download the SDK (not just runtime) for your OS
    • Install it (very small ~200 MB)
  3. Open VS Code → Go to Extensions (Ctrl+Shift+X) → Search & install:
    • C# Dev Kit (official Microsoft extension — includes IntelliSense, debugging, testing, etc.)
    • C# (the base language support)
  4. Open a folder → Create a new console app:
    Bash
  5. Press F5 to run — magic! 🚀

Quick Test – Your First “Hello World”

Create a file Program.cs (or it’s already there if you used dotnet new):

C#

Run it:

  • In Visual Studio → F5
  • In VS Code → F5 or terminal: dotnet run

You should see:

text

Congratulations! 🎉 You just ran your first C# program!

Homework for Next Class

  1. Install either Visual Studio 2026 or VS Code + .NET 10 SDK
  2. Create and run the Hello World program above
  3. Change the message to something fun about yourself (e.g., “Hi, I’m learning C# and loving it! 😍”)
  4. Run it again and feel proud!

In the next chapter, we’ll talk about Variables, Data Types, and start writing real code. Get ready — it’s going to be fun!

You may also like...