Hacker News new | past | comments | ask | show | jobs | submit login

Java can't do the ad-hoc mixing of types from different libraries, which is something I've wanted/needed for some ORM+expressions work I was doing. I really like where C# is going with this. Hopefully it will accelerate continuation of the evolution of Java.

I'm almost of the mind to use F# or C# instead of waiting.




Those are untagged union types and are less useful than you think.

For one, they don't work for generic code where you want to discriminate. I.e., if you have a generic A or B type, you can't pattern match on it. And it's hard to add restrictions to the generic types such that it would work.

Such types sort of work in TypeScript, but TypeScript also has structural typing, meaning that it's designed for it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: