4 ms·
Yes, sum types and generics solve this nicely. It's a shame Java was designed before they had generics, so the core of the language can't take advantage of the
by eru 3y ago
Yes, sum types and generics solve this nicely.
It's a shame Java was designed before they had generics, so the core of the language can't take advantage of them.
- ruszki 3y agoIt’s still possible to do something like TypeScript, where everything is like generics in Java. But Java try to be consistent, while TypeScript purposefully not. There are a ton of features in TypeScript which are awesome, but it breaks in some rare cases. Java won’t allow that.