C# ships a new version every year, and most of what arrives is small: a shorter way to write something you could already write. That makes the language pleasant to follow and slightly awkward to learn, because the answer to “how do I do X” depends on which version you are on.

This page has both halves. The first sections are the language as it stands: types, variables, control flow, pattern matching. The later ones go version by version, so you can see what a feature replaced and decide whether it is worth the upgrade.

Nothing here assumes you have written C# before. If you have, start at the version sections and work backwards.

Starting Out

Setting up, and the vocabulary the rest of the page assumes.

Control Flow

Loops, conditions and the pattern matching that has quietly replaced a lot of both.

Types, Conversions and Comments

Converting between types, and the comment styles C# actually uses.

What Each Version Added

Version by version. Each article shows the code the feature replaces, which is the fastest way to judge whether you want it.

Checking and Setting the Version

Finding out which version you are on, and telling a whole solution to use a different one.

Where to Go Next

Once the syntax is familiar, these are the next things to learn:

You do not have to adopt a feature because it is new. The ones worth taking early are the ones that remove a whole category of mistake, and the articles below say which those are.