Overview
C# is a modern, general-purpose programming language developed by Microsoft as part of the .NET platform. It combines the power of C++ with the simplicity of Visual Basic. C# supports strong typing, lexical scoping, and garbage collection. With each release, it continues to add features like pattern matching, records, and top-level statements that keep it modern and expressive.
Key Features
- Modern syntax — Records, pattern matching, nullable reference types
- .NET ecosystem — Access to the entire .NET class library
- LINQ — Language-integrated query for collections and databases
- Async/await — First-class asynchronous programming support
- Cross-platform — .NET (Core) runs on Windows, Linux, macOS
Code Example
csharp
Learning Resources
Learning Path
20 topics across 5 sections
1Basics
C# fundamentals and the .NET platform.
- Introduction to C# — .NET platform, CLI, and the C# compilation model
- Variables & Types — Value types vs reference types, var, and nullable types
- Control Flow — if/else, switch expressions, for, foreach, while
- Methods — Parameters (ref, out, in), overloading, and expression-bodied members
- Strings — Interpolation, verbatim strings, Span<char>, and StringBuilder
2OOP
Object-oriented programming in C#.
- Classes & Structs — Properties, constructors, destructors, and init-only setters
- Inheritance & Interfaces — sealed, abstract, virtual, interface default methods
- Generics — Generic classes, methods, constraints, and covariance/contravariance
- Records — Immutable reference types with value equality (C# 9+)
- Pattern Matching — is, switch expressions, property patterns, and relational patterns
3LINQ & Collections
Language-integrated queries and data processing.
- LINQ Basics — from/where/select, method syntax, and deferred execution
- LINQ Operations — GroupBy, Join, Aggregate, OrderBy, and custom operators
- Collections — List<T>, Dictionary<TK,TV>, HashSet<T>, and concurrent collections
4Async Programming
Asynchronous patterns in C#.
- async/await — Task, Task<T>, ValueTask, and async method patterns
- Parallel Programming — Parallel.ForEach, PLINQ, and data parallelism
- Channels — Producer-consumer with System.Threading.Channels
5Modern C#
Latest features in C# 10-12.
- Primary Constructors — Constructor parameters on class/struct declarations
- Collection Expressions — Simplified collection initialization with spread operator
- Source Generators — Compile-time code generation for serialization, DI, and more
- ASP.NET Core — Minimal APIs, controllers, middleware, and dependency injection