4 ms·
Generics ended up making Java's type system unsound. Not a huge deal in practice, but the following paper sheds some light on just how complex Java's type syste
by foldr 5y ago
Generics ended up making Java's type system unsound. Not a huge deal in practice, but the following paper sheds some light on just how complex Java's type system really is one you start poking around a bit:
https://dl.acm.org/doi/pdf/10.1145/2983990.2984004 https://dl.acm.org/doi/pdf/10.1145/2983990.2984004
- oblio 5y agoWell, it's even worse than that, they caused a breaking change in Java and 2 parallel type systems, if you can call them that, with primitives. They did the same for C#, where 2.0 was a breaking change from 1.1. I still think Go should have bitten the bullet earlier. Though I'm still glad they're doing it now. Just that now there's a ton more code and they're going to divide the ecosystem until adoption is widespread, from the stdlib to every minor corner of the ecosystem that needs it.
- EdwardDiego 5y ago> Well, it's even worse than that, they caused a breaking change in Java What breaking change? They implemented type erasure specifically not to break existing code.
- oblio 5y agoBad wording, sorry. It was breaking for C#, for Java I wasn't breaking, just ecosystem diving. For example, Hibernate still doesn't use generics fully, from what I remember (they had their half baked system from before). Adding them later is such a big change that touches so much code you can date it into pre generics/post generics:-)