3 ms·
The way I heard it put some time ago was, Java/JVM couldn't make some important changes because it would break backwards compatibility in an unacceptable way (I
by sdegutis 13y ago
The way I heard it put some time ago was, Java/JVM couldn't make some important changes because it would break backwards compatibility in an unacceptable way (I'm assuming this means there are mission critical apps written in Java 1 that the whole world depends on), but since C#/.NET were from scratch, they were free from this legacy baggage and could take huge steps forward.
- MichaelGG 13y agoThe JVM didn't want to break compat to add generics into the runtime, hence they adopted the erasure model. Other language features are still quite doable on top of the JVM (as evidenced by plenty of more advanced languages targeting the JVM). Yes, the CLR gets a major advantage by having a better bytecode language design, but it can't be the real reason Java didn't get lambdas until Java 8.
- ygra 13y agoActually, .NET was in pretty much the same place, because generics were only implemented in .NET 2. They chose to add the support directly to the VM, though and break compatibility. That being said, Java broke other things along the way back then, if I remember correctly, so in hindsight type erasure for fake generics was maybe not the smartest choice.