C# (C-sharp)
C# is Microsoft's modern, statically-typed language on the .NET platform. Here's what it is, how it relates to .NET, and the features that define it, with code.
What C# is
C# (“C-sharp”) is a statically-typed, object-oriented language created by Microsoft and first released in 2000. It is compiled, garbage-collected, and strongly tooled, and today it is fully cross-platform: the same C# runs on Windows, macOS, and Linux, and targets web, desktop, cloud, mobile, and games (it’s the language of the Unity engine). It pairs C-family syntax with high-level features that keep it productive without dropping to manual memory management.
C# & .NET
A common point of confusion: C# is the language; .NET is the platform it runs on. You write C#, the compiler turns it into an intermediate language (IL), and the .NET runtime (the CLR) executes that IL, compiling it to native code just in time. .NET also provides the standard library and tooling. Modern .NET (the successor to the Windows-only .NET Framework) is open-source and cross-platform; other languages like F# target the same runtime.
Signature features
- Strong, static typing with rich type inference (
var) and, since C# 8, nullable reference types that surface null bugs at compile time. - LINQ: declarative queries (filter/project/group/join) over any sequence with one syntax.
- async/await: non-blocking asynchronous code that reads sequentially.
- Generics: type-safe reusable containers and algorithms without casting.
- Records & value types: concise immutable data types with value equality.
- Properties, pattern matching, and first-class delegates/events for clean object-oriented and event-driven code.
In code
// Modern C#: records, LINQ, async/await, nullable reference types
public record Dev(string Name, int CommitsThisYear);
var team = new List<Dev> {
new("Ada", 412),
new("Linus", 1290),
new("Grace", 88),
};
// LINQ: declarative queries over any sequence
var prolific = team
.Where(d => d.CommitsThisYear > 100)
.OrderByDescending(d => d.CommitsThisYear)
.Select(d => d.Name);
// async/await: non-blocking I/O without callbacks
async Task<string> FetchAsync(HttpClient http, string url) {
return await http.GetStringAsync(url); // frees the thread while waiting
} C# vs Java vs C++
| C# | Java | C++ | |
|---|---|---|---|
| Memory | Garbage-collected | Garbage-collected | Manual / RAII |
| Runs on | .NET (CLR) | JVM | Native |
| Compiles to | IL → JIT native | Bytecode → JIT | Native machine code |
| Signature features | LINQ, async, records | Vast ecosystem, portability | Zero-cost abstractions, control |
| Typical use | Web, cloud, desktop, Unity | Enterprise, Android, big data | Systems, games, performance |
Coming from C++? The memory model is the biggest shift, see smart pointers & RAII and memory leaks for what the garbage collector handles for you. The OOP concepts and design patterns carry straight over.
FAQ
What is C# and who made it?
C# (pronounced 'C-sharp') is a statically-typed, object-oriented language created by Microsoft, first released in 2000, with Anders Hejlsberg as lead designer. It runs on the .NET platform and is used for web apps (ASP.NET), desktop, games (Unity), cloud services, and tooling.
What is the difference between C# and .NET?
C# is the language; .NET is the platform it runs on, the runtime (CLR), the standard libraries, and the tooling. You write C#, it compiles to an intermediate language (IL), and the .NET runtime executes it. Other languages (F#, VB.NET) also target .NET.
Is C# cross-platform?
Yes. Since .NET Core (now just '.NET'), C# runs on Windows, macOS, and Linux, and compiles for mobile and WebAssembly. The old Windows-only .NET Framework still exists for legacy apps, but new work targets modern cross-platform .NET.
C# vs Java, how different are they?
They are close cousins: both statically typed, object-oriented, garbage-collected, and compiled to a bytecode/IL run on a managed runtime. C# tends to adopt language features faster (LINQ, value types/records, properties, async/await came earlier, nullable reference types). Day to day, someone fluent in one reads the other easily.
What is LINQ?
Language Integrated Query: a set of language features and methods for writing declarative queries (filter, project, group, join) over any sequence, in-memory collections, databases, XML, with the same syntax. It is one of C#'s signature features.
What does async/await do in C#?
It lets you write non-blocking asynchronous code that reads like sequential code. An awaited operation (usually I/O) frees the current thread to do other work until the result is ready, instead of blocking it. It is the standard way to keep apps responsive and servers scalable.
Is C# a good language to learn in 2026?
Yes. It is mature, consistently modern, strongly tooled (Visual Studio, Rider, VS Code), and spans web, cloud, desktop, and game development (Unity). Its concepts, OOP, generics, async, also transfer directly to other mainstream languages.
C# and .NET are core to KB Cafe’s DNA, the original site was a working C#/.NET reference back when the language was new and developers were migrating from C++ and classic ASP. This is the modern restoration: what C# is now, cross-platform and several language generations on, with the fundamentals that still define it.