News for hackers. Stuff that matters.
Re:Pattern Matching for Java by sgift on Thursday April 20, 2017 @02:31AM (#14154426)
> reading this article is basically a giant advertisement for Scala and its powerful pattern matching.

Javas strength has always been to take the good parts of its competitors after they've checked out in production (and not just "wouldn't this be a great idea ..?") and implement them. It will probably never be ahead of the curve due to this, but at least it is remarkably free of "looks good in theory, useless in reality"-features.

Re:Pattern Matching for Java by RandomBK on Thursday April 20, 2017 @02:47AM (#14154484)
In general, I agree with all but your last point. There are many things in Java that were good ideas at the time of introduction, but turned out horrible (serializable, finalize, etc.)
Re:Pattern Matching for Java by sgift on Thursday April 20, 2017 @03:01AM (#14154532)
Fair enough. I think both of your examples exist since JDK 1.0 (or 1.1), though I'd have to look to be sure. I think they've wised up after that.
Re:Pattern Matching for Java by brogrammer_1 on Thursday April 20, 2017 @05:04AM (#14155075)
Type erasure for generics...
Re:Pattern Matching for Java by pron on Thursday April 20, 2017 @05:08AM (#14155098)
Wrong. Type erasure for generics is one of Java's luckiest breaks. At worst, it imposes a tiny inconvenience, but in exchange this is what allowed Java not to bake a variance model into the VM and libraries, and this is precisely what allows languages with different variance models -- like Java, Kotlin and Clojure -- to both share code and actual data objects with no runtime conversions. This is something that can't happen on .NET (see, e.g. how clumsily their Python implementation interacts with generics). This was a huge win for almost no cost.
Re:Pattern Matching for Java by ddispaltro on Thursday April 20, 2017 @08:33AM (#14156048)
I completely agree, what a blessing in disguise. Scala wouldn't be possible without it.
Re:Pattern Matching for Java by tome on Friday April 28, 2017 @05:44AM (#14218082)
It was designed in part by Phil Wadler, so it's not surprising it's a success.