4 ms·
Microsoft broke backwards compatibility when they introduced generics in .NET 2.0. Java, on the other hand, is still getting flac for refusing the break backwar
by Skinney 8y ago
Microsoft broke backwards compatibility when they introduced generics in .NET 2.0. Java, on the other hand, is still getting flac for refusing the break backwards compatibility to introduce reified generics.
- scarface74 8y agoHow did generics break backwards compatibility?
- Skinney 8y ago> Bytecode or ‘Intermediate Language’ (IL) changes. The main > place that the implementation of generics in the CLR differs > from the JVM is that they are ‘fully reified’ instead of > using ‘type erasure’, this was possible because the CLR > designers were willing to break backwards compatibility, > whereas the JVM had been around longer so I assume that this > was a much less appealing option. For more discussion on >this issue see Erasure vs reification and Reified Generics > for Java. Update: this HackerNews discussion is also worth a read. http://mattwarren.org/2018/03/02/How-generics-were-added-to-.NET/ http://mattwarren.org/2018/03/02/How-generics-were-added-to-...
- L0stLink 8y agoWhich to me is a good thing, Microsoft ripped the band-aid early and got it over with instead of delaying the inevitable.
- haglin 8y agoI think generics in Java works pretty well. Should it have been there from the beginning. Yes, but it would have delayed the release of JDK 1.0. People often complain about type erasure, but I have seen very few examples of everyday programming where it would have helped. I think type erasure was a reasonable compromise. The only real use case I can see is value types. You want List<int> to be backed by array of ints, not Integer objects. But there are already plans to add this to JVM, once value types are added.