Exploring Records and Patterns
summary
Dart 3 adds records and pattern matching: records have named and positional fields implemented in the compiler with generated equals/hashCode and immutability, requiring a trailing comma for single-value records; destructuring works for records, lists and maps but fails at runtime if shapes mismatch. Examples show cross-library compatibility by form (point/coordinate), a small geometry library built to prove it, and workarounds like immediately-invoked functions for multi-line switch expressions return values; data classes remain the top requested feature.
AI-written summary · about
chapters (6)
- 0:00Introduction to Dart features
- 2:57Understanding Dart records
- 11:50Destructuring records and objects
- 24:17Pattern matching in Dart
- 35:21Future of Dart features
- 38:12Conclusion and best practices
related talks
37mRecord Patterns - Going Beyond Records - A Deep Dive
50mPattern Matching in Java Deep Dive
39mPattern Matching: Small Enhancement or Major Feature?
52mPattern Matching: Small Enhancement or Major Feature?
34mA Taste of Prolog
29mThe Art of Java Language Pattern Matching
46mThe Art of Java Type Patterns
54mPattern Matching in Java: Past, Present, Future
