~/talk

Pattern Matching: Small Enhancement or Major Feature?

Talkat J-Fall 2022 · on Thursday, 2022-11-03· [java, compilers-and-language-design]
slides:none on file

Pattern matching removes repetitive casts (JEP 305) and binds variables inline, cutting an equals implementation to a one‑liner and a switch example from ~25 lines to 11 while keeping business logic visible. Pattern matching for instanceof (Java 14 preview, finalized Java 16) and pattern matching for switch (arrived in Java 17, still evolving in Java 20 previews) work with records and sealed types; deconstruction/record patterns are in preview and enable direct field binding. Demos compile and tests run; proposed future uses include safer, readable serialization via constructor/destructor annotations.

AI-written summary · about

  1. 0:00Introduction to pattern matching
  2. 1:09Java community and research
  3. 2:34What is pattern matching?
  4. 6:12Type pattern demo
  5. 9:26Type pattern in Java 16
  6. 10:09Pattern matching in switch
  7. 14:44Visitor pattern alternative
  8. 17:20Guarded patterns in switch
  9. 21:16Deconstruction patterns
  10. 23:48Deconstruction in records
  11. 28:38Pattern combinations
  12. 33:24Deconstruction pattern availability
  13. 34:07Sealed types and records
  14. 37:05Future serialization with patterns
  15. 42:00Unnamed patterns
  16. 48:32Pattern bind statements
  17. 49:36Future array patterns
  18. 50:18Conclusion: Major feature
~/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.