Last Updated: May 22, 2026
C# is one of the most widely used programming languages in the world. It runs Unity games on your phone, the backend of large online stores, cloud services in Microsoft Azure, the trading systems behind financial firms, and a lot of the internal software at Microsoft itself. This lesson gives you a high-level picture of what C# is and why it has stayed in the top tier of programming languages for more than two decades.
C# is a general-purpose, object-oriented, statically typed, type-safe programming language that runs on the .NET platform. Each piece in plain language:
General-purpose means C# isn't built for one narrow job. A desktop app, a website's backend, a mobile app, a game, a cloud service, or a machine learning model can all be written with it. Compare that with something like SQL, which is designed for one job (querying databases). C# is more like a Swiss Army knife usable across many kinds of software.
Object-oriented means C# organizes code around objects. An online store might have a Product object, a Customer object, an Order object, and so on. Each object holds its own data and the actions that can be performed on it. The full picture comes later in the course. The short version: C# is designed for modeling real things in a program as objects.
Statically typed means every variable has a fixed type, and the compiler checks usage before the program runs. Declaring a variable for a number and then assigning text produces a compile error at the mistake. This catches a large class of bugs before users ever see them.
Type-safe is closely related but distinct. The C# compiler and runtime work together to prevent reading past the end of an array or interpreting one type as a completely different one in memory. Some older languages allow that, leading to crashes and security holes. C# blocks those classes of bugs by design.
A "paradigm" is a style of organizing code. Some languages lock you into one style. C# supports several, and most real C# code mixes them. The styles to know:
Object-oriented. This is the default style in C#. Classes (templates for objects) are defined, and objects are created from them. Each object groups data and the operations on that data. An online store's Cart class would hold the list of items and the methods for adding, removing, and pricing them. Most of the C# code in this course is object-oriented.
Functional. C# borrows ideas from functional languages: small functions, immutable data, and treating functions as values that can be passed around. A common example is LINQ, the query syntax C# uses to filter and transform collections. products.Where(p => p.Price < 50).Select(p => p.Name) returns the names of cheap products. The LINQ section covers it in detail.
Generic. Generics allow code that works for any type. A List<Product> and a List<Customer> use the same List<T> implementation internally. The logic is written once, and the compiler specializes it for each type. This avoids duplicate code and keeps things type-safe at the same time.
Declarative. Sometimes the code describes what's wanted instead of how to get it. LINQ is the clearest example: from p in products where p.InStock select p.Name reads like a sentence and lets the runtime figure out the steps. Async/await also falls into this camp. The order of operations is described, and the runtime handles the scheduling.
C# is intentionally flexible. Plain objects and methods work when starting out, and the more advanced styles are available when they make a problem easier.
C#'s reach is broad. The main areas:
Games (especially Unity). Unity is a widely used game engine, and the scripting language for Unity is C#. Many mobile games of the last decade were built in Unity with C# code on top. Pokemon Go, Among Us, Hearthstone, Beat Saber, Cuphead, Cities: Skylines, and Hollow Knight are all Unity games written in C#. Indie studios and large companies alike use Unity, making C# one of the standard languages for game development today.
Web backends with ASP.NET Core. When checking out at an online store, the server that processes the payment, updates the cart, and sends a confirmation email is often a C# program built with ASP.NET Core. Stack Overflow, the question-and-answer site many programmers use, famously runs on ASP.NET. Microsoft's own services, including parts of Bing and many Azure features, are built on ASP.NET Core. The framework is fast, mature, and free.
Cloud services on Azure. Microsoft Azure is one of the three biggest cloud platforms, and C# is its first-class language. A small function that runs on a schedule, a microservice that scales to thousands of instances, or a large distributed system can all be written in C# with tight integration into Azure's tooling. Many companies that already use Microsoft software end up on Azure for this reason.
Desktop apps for Windows. Visual Studio, parts of Microsoft Office, and many internal business apps inside large companies are C# desktop software. WPF (Windows Presentation Foundation) and WinUI are the modern frameworks for building these apps. They're still widely used in enterprise settings where Windows is the default operating system.
Cross-platform mobile and desktop with .NET MAUI. .NET MAUI allows one C# codebase to run on Windows, macOS, iOS, and Android. It's the successor to Xamarin, which Microsoft acquired years ago. Companies that want a single team and a single codebase across mobile platforms use MAUI.
Web frontends with Blazor. Blazor is a relatively new framework for building interactive web UIs in C# instead of JavaScript. The C# code can run in the browser through WebAssembly, or on the server with the UI updates streamed down. It's an unusual approach, and it's caught on with teams that already have a lot of C# expertise and don't want to maintain a separate JavaScript stack.
AI and machine learning with ML.NET. Microsoft maintains ML.NET, a machine learning framework for C#. It's not as popular as Python's libraries for new research, but it allows teams that already work in C# to build and ship ML features without switching languages. Tasks like product recommendations, sentiment analysis, and anomaly detection are common use cases.
The diagram shows the common thread. These very different kinds of software all run on the same underlying platform: .NET. C# code is compiled and executed by .NET, which handles memory, threading, and the parts of the runtime that make a program work. The _.NET Ecosystem (CLR, BCL, SDK)_ lesson goes deeper.
A tiny C# program for the language to feel concrete instead of abstract:
A few details. The line using System; brings in part of the standard library so Console.WriteLine works. Three variables hold a store name, a product name, and a price. The Console.WriteLine lines print to the screen, and the $"..." syntax (called string interpolation) places variable values directly into text using curly braces.
This is a complete C# program written in the modern style, using top-level statements. Older C# code wraps everything in a class and a Main method, and that style is still common.
C# first appeared in 2002. Most programming languages from that era are either gone or stuck in legacy codebases. C# is the opposite. It's still one of the top languages on every popularity ranking, it gains new features every year, and it's actively used in greenfield projects across many industries. The reasons:
Microsoft's stewardship. Microsoft funds C# development and treats it as a strategic language. The team behind C# ships a new major version every year, with thoughtful design and careful backward compatibility. That investment isn't a guarantee of quality, but in C#'s case it's resulted in steady, well-considered evolution rather than feature churn.
Open source and cross-platform. For its first decade, C# was tied to Windows. That changed with .NET Core in 2016 and especially with .NET 5 and later. Today, C# and .NET are open source, run natively on Windows, macOS, and Linux, and have first-class support across all three. The transition from Windows-only to truly cross-platform attracted teams that wouldn't have considered C# before.
Performance. Modern .NET is fast. Benchmarks consistently put it near the top for web framework throughput, sometimes ahead of Go and not far behind hand-tuned Rust. The runtime does aggressive optimization, including just-in-time compilation and a low-pause garbage collector. For backend services handling thousands of requests per second, the performance is more than competitive.
A large ecosystem. Most new C# projects start with NuGet, the package manager for .NET, which hosts hundreds of thousands of libraries: database access, web frameworks, authentication, image processing, machine learning, testing, and many more. The community has been building these libraries for over two decades, and the well-maintained ones are mature.
Modern language features. C# has adopted modern ideas: async/await for asynchronous code (one of the first mainstream languages to do this), nullable reference types, pattern matching, records, and many more. Writing C# today differs significantly from C# in 2005, and most of those changes have made the language safer and more concise without breaking old code.
"C#" and ".NET" are used together so often that the relationship deserves a quick note now, even though detail comes later.
C# is the language. .NET is the platform the language runs on. The C# compiler turns code into a format called Intermediate Language (IL). That IL runs inside the .NET runtime, which handles memory management, security, threading, and provides a huge library of pre-built functionality.
A few names that come up:
C# is the language and .NET is the platform underneath it. The _History of C#_ lesson walks through C#'s history from version 1.0 in 2002 to the present. The _Features of C#_ lesson covers the main features in more depth. The _.NET Ecosystem (CLR, BCL, SDK)_ lesson takes a closer look at the .NET ecosystem itself, including the CLR (the runtime), the BCL (the base class library), and the SDK (the developer tools).