3 ms·
> What about Generics is broken? I'm going to be slightly handwavy, so forgive me: Generics are implemented by doing type erasure[1] rather than as 'real gener
by steveklabnik 16y ago
> What about Generics is broken?
I'm going to be slightly handwavy, so forgive me: Generics are implemented by doing type erasure[1] rather than as 'real generics' through some other method. This causes issues with runtime reflection.
> would replicate their abilities through interfaces and anonymous classes,
This embodies exactly what I hate about Java: In other languages, where I simply 'do/end' or ' \ ->', I have to create a whole giant pile of boilerplate bullshit to pull off something that's supposed to be easy.
1: http://en.wikipedia.org/wiki/Generics_in_Java#Type_erasure http://en.wikipedia.org/wiki/Generics_in_Java#Type_erasure
- sukuriant 16y agoOn Generics: I did not know they performed that slight-of-hand, internally. That does make them rather weak. On Java-bloat: to be fair, it's really not that much, especially if it's already a known interface: new TreeSet<Foo>(new Comparator<Foo>() { public void compare(Foo a, Foo b) { mycode(); } }); However, your point stands. I've just come to accept that as being a part of Java, myself.