~/talk

Pattern Matching: Small Enhancement or Major Feature?

slides:none on file

Shows that pattern matching for instanceof (JEP 305, landed in Java 14 and finalized in Java 16) compresses type test + cast + bind into one expression, and that pattern matching for switch (preview in Java 17/18) replaces long else-if chains with typed cases, guarded patterns and null labels. Demonstrates deconstruction patterns, pattern definitions, var/any/array patterns, and how records + sealed types make switches exhaustive. Proposes using pattern definitions to drive safer, readable serialization and links demo code on GitHub.

AI-written summary · about

  1. 0:00Introduction
  2. 5:16Practicalities
  3. 8:34Effects
  4. 16:45Guarded Patterns
  5. 18:23Deconstruction Patterns
  6. 26:35Seal Types
  7. 30:42Better Serialization
  8. 35:33More Ideas
  9. 37:53Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.