{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "aeca266c",
   "metadata": {},
   "source": [
    "# Modern C# Next\n",
    "\n",
    "<!-- chapter-intro -->\n",
    "\n",
    "Modern C# has evolved well beyond its Java-inspired origins. This chapter covers\n",
    "language features that make C# code more expressive, concise, and readable —\n",
    "without requiring a deep class hierarchy."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "033dfe4b",
   "metadata": {},
   "source": [
    "<h2>Why these features matter</h2>\n",
    "\n",
    "These five features appear constantly in modern C# codebases:\n",
    "\n",
    "- **Pattern matching** — replaces chains of `if`/`else` and `is`/`as` casts with clear, structural dispatch\n",
    "- **Record types** — eliminate boilerplate for data-carrying types; you have been using them since Ch.9 — now we name what they give you\n",
    "- **Nullable operators** — make null-handling explicit and safe; `?.`, `??`, `??=` are in every real codebase\n",
    "- **Generics** — explain the `<T>` you have been using in `List<T>` and LINQ; writing generic methods and classes yourself reduces duplication\n",
    "- **Async/await** — keep programs responsive while waiting for files, networks, or databases without writing complex threading code"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d27d89fc",
   "metadata": {},
   "source": [
    "<h2>Learning goals</h2>\n",
    "\n",
    "By the end of this chapter, you should be able to:\n",
    "\n",
    "- use `switch` expressions and `is` patterns to match on type and structure\n",
    "- explain what `record` adds over `class`: value equality, `with`, deconstruction, and `init`-only properties\n",
    "- choose between `record`, `class`, and `struct` for a given design\n",
    "- handle null safely using `?.`, `??`, `??=`, and nullable annotations\n",
    "- write and read generic methods and classes that use `<T>` and type constraints\n",
    "- call `async` methods using `await` and understand when asynchrony is appropriate\n",
    "\n",
    "<h2>Chapter flow</h2>\n",
    "\n",
    "```{tableofcontents}\n",
    "```\n"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
