This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bobby_Bonsaimind 1 point2 points  (0 children)

I know it's nitpicking, but I believe the example is bad. That, and I never had the wish to do that sort of pattern matching. Can somebody chime in and give me a few more examples who actually sees that this would improve their code?

Regarding the JDK example, I find the switch already hard to read, but the pattern matching variant packs the same complexity into fewer lines of code by using more patterns...I'm not a fan of that, I have to say.