Pattern matching for switch in Java (JDK 17)

Old problems, new ways of solving it? If all you have is a hammer, everything looks like a nail. This sentence summarizes pretty much how I felt about the idiomatic polymorphism approach in Java to most problems until recently. Polymorphism is just a tool and as for any tool, it excels at some tasks and performs poorly at others. So what are the tasks where polymorphism does a good job at?...

<span title='2021-06-28 21:25:00 +0200 CEST'>June 28, 2021</span>&nbsp;·&nbsp;12 min&nbsp;·&nbsp;Loïc Rouchon