Hacker News new | ask | show | jobs
by Sharlin 53 days ago
But OOP’s insistence on dispatching "at the leaves" is mostly understood as misguided or overly dogmatic these days. In particular, tagged unions and pattern matching are incredibly useful tools that go right against OO dogma. And they’ve always been so, since their introduction in the early 70s. The entire idea of "objects combine behavior and data" is problematic in many ways, not least because it can be very suboptimal on modern hardware compared to data-oriented approaches.
2 comments

I strongly feel that pattern matching is the most useful language feature that there is for writing code that's correct and easy to understand. Once you've used a language that has it, you never really want to go without it again.