- Lengthy explanation
- Convo w/ Anders Hejlsberg (lead C# architect, on generics in Java, C#, and C++)
- Stackoverflow discussion
- Reddit discussion
Summary:
In short, all that Java generics permit is greater type safety with no new capabilities, with an implementation that permits blatant violation of the type system with nothing more than warnings
Furthermore, C#/.NET convey additional performance benefits due to the lack of required casts (as the verifier ensures everything is kosher) and support for value types (Java generics don't work with the builtin types like int), thus removing the overhead of boxing, and C# permits faster, more elegant, more understandable, and more maintainable code.
No comments:
Post a Comment