A great read for folks wondering why Java uses type erasure instead of “reified” generics. For the unaware, that means that a List<Integer> is a List<Object> at runtime. I had always wondered about it and why they didn’t take the alternative route. For context, C# does have reified types so the actual type parameter is available at runtime.

I personally love reading in depth discussions about counter intuitive engineering decisions like this.

  • kaba0
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Note that Java’s generics are on the library-side, while Scala’s is defined at use site.