C# is a statically typed, general-purpose language that Microsoft announced in July 2000 as the flagship language of its new .NET platform. To understand why Microsoft created C# after the Java lawsuit, you have to go back to 1997, when Sun Microsystems sued Microsoft over Visual J++, arguing that its Windows-specific extensions violated the terms of Microsoft's Java license. The dispute made it clear that Microsoft could not build its long-term developer strategy on a language controlled by a competitor.

Why Microsoft created C# after the Java lawsuit

Microsoft already had a managed runtime project underway, and it needed a modern language to go with it. The job went to Anders Hejlsberg, who had written Turbo Pascal and served as chief architect of Delphi at Borland before joining Microsoft in 1996. Internally the language was called Cool, short for "C-like Object Oriented Language." By the time it was shown publicly at the Professional Developers Conference in 2000, it had been renamed C#, a nod to the musical sharp sign and, loosely, to C++ with the plus signs stacked.

The settlement with Sun came in January 2001, but by then the plan was set. C# 1.0 shipped with .NET Framework 1.0 and Visual Studio .NET in early 2002. Microsoft also took the language through standards bodies: it became ECMA-334 in December 2001 and ISO/IEC 23270 in 2003, which later made independent implementations such as Mono possible.

Design and key features

Early C# looked a lot like Java: curly braces, single inheritance of classes, interfaces, garbage collection and compilation to an intermediate language that the Common Language Runtime compiles to native code at run time. Hejlsberg's Delphi background showed in the details, though. C# had properties, events and delegates from day one, value types via struct, a unified type system where even int derives from object, and an unsafe mode with real pointers for interop.

The language then grew far beyond its Java roots:

  • Generics (C# 2.0), implemented in the runtime rather than by type erasure.
  • LINQ, lambdas and type inference with var (C# 3.0).
  • async/await (C# 5.0), which made asynchronous code readable.
  • Pattern matching, tuples, records and nullable reference types in the 7.x to 9.0 releases.

A short C# example

This modern C# program uses top-level statements, a record, LINQ and a switch expression with relational patterns:

using System;
using System.Linq;

var langs = new[]
{
    new Language("C#", 2000),
    new Language("F#", 2005),
    new Language("Go", 2009)
};

foreach (var l in langs.Where(x => x.Year >= 2000).OrderBy(x => x.Year))
{
    string era = l.Year switch
    {
        < 2005 => "early .NET",
        _ => "later"
    };
    Console.WriteLine($"{l.Name} ({l.Year}) - {era}");
}

record Language(string Name, int Year);

Versions and milestones

YearVersionNotable change
2002C# 1.0First release with .NET Framework 1.0
2005C# 2.0Generics, nullable value types, iterators
2007C# 3.0LINQ, lambda expressions, extension methods
2012C# 5.0async and await
2015C# 6.0First release on the open-source Roslyn compiler
2020C# 9.0Records, top-level statements

Since .NET 5 in 2020, a new C# version has shipped every November alongside the yearly .NET release.

Where C# is used today

For years C# meant Windows. That changed when Microsoft open-sourced the Roslyn compiler in 2014 and released the cross-platform .NET Core in 2016. Today the same language runs on Linux servers, macOS, containers and mobile devices. Common uses include:

  • Web APIs and sites built with ASP.NET Core, including Stack Overflow.
  • Game development in Unity, the most common reason people learn C#, and in Godot.
  • Desktop software with WinForms, WPF and WinUI, plus cross-platform apps with .NET MAUI.
  • Cloud services on Azure and line-of-business systems in banking, insurance and healthcare.

Influence on other languages

Hejlsberg went on to design TypeScript in 2012, and the family resemblance is obvious. The async/await model that C# made mainstream, building on F#'s earlier async workflows, was later adopted by JavaScript, Python, Rust and Swift. Kotlin and Swift also borrowed ideas such as properties, extension methods and null-safety features that C# programmers knew well.

Should you learn C#?

If you want to make games in Unity, build enterprise back ends or work in a Microsoft-heavy company, C# is a very practical choice. The tooling is excellent, the documentation is thorough and the language keeps improving without breaking old code. Knowing why Microsoft created C# after the Java lawsuit also explains a lot about its character: it started as a safer, Windows-friendly Java and turned into one of the most feature-rich mainstream languages around.

Frequently asked questions

Is C# just Microsoft's copy of Java?

The first version was clearly shaped by Java, and critics said so at the time. But C# shipped with properties, delegates, value types and unsafe code from the start, and later added runtime generics, LINQ and async/await well before Java had comparable features. Today the two languages differ in many important ways.

Who designed C# at Microsoft?

Anders Hejlsberg led the design, after earlier work on Turbo Pascal and Delphi at Borland. He headed the C# language team for many years, while Mads Torgersen later became its lead designer.

Does C# still run only on Windows?

No. Since .NET Core arrived in 2016, C# programs run on Windows, Linux and macOS, and .NET is open source. Mono and Xamarin had already brought C# to other platforms before that.