Change your habits: Modern techniques for modern C#
summary
Demonstrates concrete C# practices: using tuple assignments for swaps and concise equality/constructors, declaring read-only structs and read-only members to let the compiler enforce immutability, and enabling nullable reference types plus the ?? throw discard pattern to replace verbose null checks. Builds a toll-calculator with a pattern-matching switch that shrinks a 50-line if/else into six concise rows, and shows DateTime.AddYears to avoid a leap-year bug — all working code-level fixes and refactorings.
AI-written summary · about
chapters (26)
- 0:00Introduction
- 5:00Point class
- 6:40tuples
- 8:10tuple assignment
- 12:28tuple tricks
- 13:15readonly struct
- 17:14readonly properties
- 19:41enforce your design
- 20:40knowable reference types
- 22:45nullable reference
- 26:28throw expression
- 27:38argument null exception
- 34:38pattern matching
- 36:15switch expression
- 37:38range patterns
- 38:28imperative method
- 39:35business requirements
- 40:01using pattern matching
- 40:41building the table
- 43:48discards
- 45:26how clear is that
- 46:05quiz
- 46:38generate subscription
- 47:27datetime
- 52:13do some research
- 53:58MS New CSharp








