3 ms·
There's nothing wrong with Java generics. Reified generics are a design choice. As someone who uses a lot of non-Java JVM languages, I'm thankful interop is eas
by james-mcelwain 6y ago
There's nothing wrong with Java generics. Reified generics are a design choice. As someone who uses a lot of non-Java JVM languages, I'm thankful interop is easier.
- eloff 6y agoThere's a lot wrong with them. You may like the design choice, but I can find plenty of people who hate it.
- pron 6y agoThose "plenty of people" think they hate it because they don't understand it (especially the problem of variance). The only languages (in relatively common use) that reify generics for variant types are C++ and C#, and both of their variance models are fucked up, albeit in different ways. If reference-type generics were reified, Java couldn't serve as a platform for so many languages. In other words, they might hate it, but they would have hated the alternative even more. Specializing generics for invariant types is another matter, and Java is getting those.