4 ms·
And don't forget Java's type erasure. Still wondering how they could actually call that a FEATURE.
by codingbinary 11y ago
And don't forget Java's type erasure. Still wondering how they could actually call that a FEATURE.
- potatosareok2 11y agoWas erasure necessary to maintain backwards compatibility? Also what are you doing that you need type information at runtime?
- dmm 11y agoNo it wasn't necessary to maintain backwards compatibility. Type erasure was implemented to allow libraries to upgrade to generics without breaking compatibility with existing applications.
- wtetzner 11y agoHow is that not backwards compatibility?
- codingbinary 11y agoThe one is on a language level, the other on an application/framework level.
- codingbinary 11y agoType Erasure is the reason you can't use builtin types as generic arguments. And in a lot of cases it forces you to cast. And as type erasure happens very, very early in the compilation process, you lose a lot of static type information the compiler could act on or give you warnings.