You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
C# (pronounced "C sharp") is a modern, object-oriented programming language developed by Microsoft. It is the flagship language of the .NET ecosystem and is used for building everything from desktop applications to cloud services, games, and mobile apps.
C# was originally designed as a language for the .NET Framework on Windows, but with the introduction of .NET Core (now simply .NET), it became a cross-platform language running on Windows, macOS, and Linux.
C# runs on the .NET runtime, which provides a managed execution environment:
| Component | Description |
|---|---|
| .NET SDK | Tools for building, running, and publishing .NET applications |
| CLR (Common Language Runtime) | The virtual machine that executes .NET code |
| BCL (Base Class Library) | Standard library with thousands of built-in types |
| NuGet | Package manager for .NET (like npm for JavaScript) |
| MSBuild | Build system for compiling and packaging projects |
| Generation | Description |
|---|---|
| .NET Framework | Windows-only, original runtime (1.0–4.8) |
| .NET Core | Cross-platform rewrite (1.0–3.1) |
| .NET 5+ | Unified platform — the future of .NET |
Tip: New projects should always target .NET 8 (LTS) or later. The .NET Framework is in maintenance mode.
C# is an incredibly versatile language:
| Application Type | Framework / Technology |
|---|---|
| Web APIs | ASP.NET Core |
| Web Applications | ASP.NET Core MVC, Razor Pages, Blazor |
| Desktop (Windows) | WPF, WinForms, WinUI, MAUI |
| Mobile | .NET MAUI (iOS, Android) |
| Games | Unity (the world's most popular game engine) |
| Cloud / Microservices | ASP.NET Core, Azure Functions, gRPC |
| IoT | .NET IoT Libraries |
| Machine Learning | ML.NET |
| Console Tools | .NET Console Applications |
| Feature | C# | Java | Python | TypeScript |
|---|---|---|---|---|
| Typing | Static, strong | Static, strong | Dynamic, strong | Static, strong |
| Platform | .NET (cross-platform) | JVM (cross-platform) | CPython | Node.js / Browser |
| Performance | High (compiled + JIT) | High (compiled + JIT) | Moderate (interpreted) | Moderate |
| Primary use | Enterprise, games, web | Enterprise, Android | Data science, scripting | Web front-end |
| Null safety | Nullable reference types | Optional, limited | No | Strict null checks |
| Async model | async/await (built-in) | CompletableFuture | asyncio | async/await |
C# is a multi-paradigm language supporting:
// Hello World in modern C# (top-level statements)
Console.WriteLine("Hello, World!");
Or with the traditional structure:
namespace HelloWorld;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
C# is a powerful, modern programming language backed by Microsoft and a vibrant open-source community. It runs on the cross-platform .NET runtime and is used for web, desktop, mobile, games, cloud, and more. In the following lessons, we will set up a development environment and begin exploring C#'s syntax and features in detail.