Write Better C# Code: Underutilized Features for Modern Development (Deep Analysis)

Session Date: Microsoft Build 2025
Duration: ~15m (estimated)
Venue: Build 2025 Conference – A‑Team Stage
Speakers: Mads Torgersen (Lead Designer of C#)
Link: Recording link

NOTE: The raw transcript file for this session is empty in the repository. Timeframes below are reconstructed/estimated from the ~15‑minute stated duration and typical pacing of a Build demo talk. Each section clearly indicates the speaker (Mads) and marks estimates with ≈. Replace with precise timestamps if/when an authoritative transcript becomes available.


Table of Contents

  1. Executive Summary
  2. Pattern Matching Deep Dive
  3. Records and Value Semantics
  4. Collection Expressions Unified Syntax
  5. Practical Implementation Guidance
  6. Migration & Adoption Strategy
  7. Technical Advantages & Developer Experience

1. Executive Summary

Timeframe: ≈00:00:00 – 00:01:30
Duration: ≈1m 30s
Speakers: Mads Torgersen

Mads frames the session around three already shipped but underutilized C# features—pattern matching, records, and collection expressions—arguing that elevating everyday code quality is often about using what you already have rather than chasing brand‑new syntax.

2. Pattern Matching Deep Dive

Timeframe: ≈00:01:30 – 00:06:00
Duration: ≈4m 30s
Speakers: Mads Torgersen

Pattern matching turns the type system + data shape + conditional logic into a cohesive declarative construct.

Core Concepts

  • Unified is expressions that both test and extract
  • Switch expressions compact multi-branch logic
  • Property & positional patterns allow structural decomposition
  • List patterns unlock declarative sequence reasoning

3. Records and Value Semantics

Timeframe: ≈00:06:00 – 00:09:00
Duration: ≈3m 00s
Speakers: Mads Torgersen

Records shift the default mental model from identity to value. Ideal for DTOs, configuration, domain primitives.

4. Collection Expressions Unified Syntax

Timeframe: ≈00:09:00 – 00:11:30
Duration: ≈2m 30s
Speakers: Mads Torgersen

Goal: a single initialization style across arrays, List<T>, immutable collections, and interfaces.

5. Practical Implementation Guidance

Timeframe: ≈00:11:30 – 00:12:30
Duration: ≈1m 00s
Speakers: Mads Torgersen

Guidance on when to use which feature and refactoring strategies.

6. Migration & Adoption Strategy

Timeframe: ≈00:12:30 – 00:13:30
Duration: ≈1m 00s
Speakers: Mads Torgersen

Step-by-step approach to adopting these features in existing codebases.

7. Technical Advantages & Developer Experience

Timeframe: ≈00:13:30 – 00:14:30
Duration: ≈1m 00s
Speakers: Mads Torgersen

Benefits in terms of optimization, safety, expressiveness, and maintainability.


This document provides estimates and structured analysis in the absence of an official transcript. Replace all timestamps with precise data when source media becomes available.