Tech News
← Home  ·  All topics

Pattern Matching

3 GoKawiil briefs on this topic

Java's sealed classes add compile-time exhaustiveness checks, new breaking-change risk

A technical explainer describes how sealed classes, introduced in Java 17, let developers restrict which subtypes can implement an interface or extend a class, enabling the compiler to verify that switch expressions handle every possible case without a default branch. The piece notes that forgetting a case triggers a compile-time error rather than a runtime failure, demonstrating this with a toy SealedType example using records.

Essay argues pattern matching outperforms narrative reasoning in business decisions

A business writer reflects on failed investments and startup ideas driven by appealing but oversimplified stories, such as betting on marijuana legalization or a cobalt miner's Tesla contract. The essay argues that compelling narratives feel persuasive because they simplify an overwhelming, multi-causal world, but that this simplicity often leads to poor real-world bets.

TXR Combines Pattern Matching and Lisp for Text Data Extraction

TXR is a programming language created by Kaz Kylheku in 2009 that pairs a whole-document pattern-matching and extraction system with a full data-processing language, letting users run quick one-liners or write complex scripts to pull structured data out of messy text. The project has grown substantially over the years, with its reference manual now spanning hundreds of pages and offering many ways to solve the same extraction problem.