3 ms·
With switch, records, and (soon?) sealed interfaces, Java will be more pleasant than ever. Would I ever choose it if I were in charge of a project? Probably no
by whateveracct 7y ago
With switch, records, and (soon?) sealed interfaces, Java will be more pleasant than ever.
Would I ever choose it if I were in charge of a project? Probably not. But it is nice that the language is incorporating these proven features that make a huge difference. It'll make working in Java when I'm not in charge much nicer.
- whateveracct 7y agoOne question about sealed: Does anyone know how it will play with type parameters in the interface? I know in Scala, you can simulate GADTs with that. sealed interface Expr<A> {} record IntExpr(Integer i) implements Expr<Integer> { } record StringExpr(String i) implements Expr<String> { } Will that be legal? And will switch be able to do its magic and carry that type variable through?