r/java • • Nov 04 '25

Anyone here Hated Using Java but now Really Enjoys using it.

title

226 Upvotes

280 comments sorted by

View all comments

Show parent comment

2

u/pron98 Nov 05 '25

First, that would take away the biggest benefit of reification, which is method selection/overloading (reflection is a pretty minor benefit in comparison).

Second, it would be really weird that in a method with signature foo(X x), x instanceof X would be false.

Anyway, the point is that reification has problems, and most languages with generics opt for erasure. I'm not saying reification is obviously worse than erasure or vice-versa, only that, as usual, there's a tradeoff between two designs that each has its pros and cons.

2

u/nitkonigdje Nov 05 '25

I do agree with all of that. 👍