Generics everywhere – but they are not the same

Generics everywhere – but they are not the same

Speaker: Adam Furmanek

Level: 200

.NET as other platforms supports generics. They allow us to write strongly typed code just once and reuse it for multiple types. Even though this sounds easy, generics are actually quite complicated under the hood and each platform implements them differently.

We will see different approaches for implementing generics. We will compare reification in .NET, type erasure in JVM and templates in C++. We will see why stronger type system sometimes is less powerful and why casting everything to object can be better than storing a concrete type. We will see what had to be done to support generics in .NET and why they were not available since the very beginning.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close