News for hackers. Stuff that matters.
Re:Java 8 Features by dignati on Friday May 30, 2014 @11:20AM (#7822250)
Wow that's a real pain point. Why would they even do that, is there a use case?
Re:Java 8 Features by ZoFreX on Friday May 30, 2014 @11:27AM (#7822283)
Backward compatibility - you could run an application that uses generics, introduced in Java 1.5, on a Java 1.4 VM. At the time that was pretty amazing. These days, with so many backward compatibility-breaking changes being introduced, it doesn't feel so great.
Re:Java 8 Features by mcculley on Friday May 30, 2014 @04:22PM (#7823817)
That was the original plan, but it never worked in my experience. The compiler as shipped required that -source 1.5 use -target 1.5. So hobbling the language this way served no benefit in the end.
Re:Java 8 Features by tomp on Friday May 30, 2014 @01:39PM (#7823023)
Btw, type erasure is only a problem for Java because it supports runtime type information (which is incomplete, because of type erasure), and overloading (which I have no idea why the compiler can't handle). For languages like ML and Haskell, type erasure is no problem, because you can't access the types at runtime anyways.
Re:Java 8 Features by im3w1l on Friday May 30, 2014 @12:20PM (#7822595)
In my opinion, no it really isn't. You can just create a method with a different name or a static constructing method if you need to overload constructors.

The major pain point with generics is that they don't work with primitives.