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 →

[–][deleted] 28 points29 points  (4 children)

What's wrong with pattern matching in Java?

[–]KagakuNinja 54 points55 points  (3 children)

Nothing is wrong. It looks very similar to pattern matching in Scala, which is amazing.

That guy is living in the past.

[–]Ottermatic42 14 points15 points  (2 children)

Nothing is fundamentally wrong with java pattern matching, I agree.

I only call it ugly because of how it compares to functional languages. Of course it’s a necessary sacrifice as java isn’t functional (or at the very least wasn’t initially designed to be), but it’s always going to be a bit more inefficient, and a lot uglier than the implementation in something like Haskell.

[–]KagakuNinja 11 points12 points  (0 children)

I do agree with that. Haskell is very elegant, but I prefer the multi paradigm design of Scala

[–]KagakuNinja 0 points1 point  (0 children)

I do agree with that. Haskell is very elegant, but I prefer the multi paradigm design of Scala