News for hackers. Stuff that matters.
Re:Java Generics Are Turing Complete by the_af on Thursday May 26, 2016 @09:50AM (#11777908)
I guess it's one thing to claim Java generics have problems and another to claim they are "useless".

They are a big improvement over not having generics and, in my experience, one seldom sees those workarounds you mentioned. Sure, when they are necessary they are ugly... but how often are they needed in standard application code?

Re:Java Generics Are Turing Complete by kodfodrasz on Thursday May 26, 2016 @09:58AM (#11777966)
Last week wanted to use GSON in a generic method to deserialize to a type which is generic type parameter, in a method of the abstract base class. Unfortunately it could not be done without the implementations passing up their .class via super constructor.

IMHO deserializing JSON is quite a common application code.

If you are really interrested I'd create example code, but (as being lazy, and the mentioned code not being my property) I'd hope to take my word for granted :)

edit: I wrote useless in many cases!

Re:Java Generics Are Turing Complete by slantedview on Thursday May 26, 2016 @12:13PM (#11779107)
There are ways to resolve generics declared on base classes:

https://github.com/jhalterman/typetools

...but proper support of reified generics certainly would have been better.

Re:Java Generics Are Turing Complete by dpark on Thursday May 26, 2016 @10:53AM (#11778380)
> I guess it's one thing to claim Java generics have problems and another to claim they are "useless".

I guess that's why the original comment said useless in many cases. Not completely useless. The next sentence also said they are way better than no generics.