3 ms·
The future of Java looks a lot like Kotlin. Aside from value classes, all of the mentioned features are present in Kotlin: - Data classes: https://kotlinlang.o
by shadowfacts 10y ago
The future of Java looks a lot like Kotlin. Aside from value classes, all of the mentioned features are present in Kotlin:
- Data classes: https://kotlinlang.org/docs/reference/data-classes.html https://kotlinlang.org/docs/reference/data-classes.html
- Type inference: https://kotlinlang.org/docs/reference/basic-types.html https://kotlinlang.org/docs/reference/basic-types.html
- Switch as an expression: https://kotlinlang.org/docs/reference/control-flow.html#when-expression https://kotlinlang.org/docs/reference/control-flow.html#when...
- Destructuring: https://kotlinlang.org/docs/reference/multi-declarations.html https://kotlinlang.org/docs/reference/multi-declarations.htm...
- cle 10y agoThese existed long before Kotlin.
- chei0iaV 10y agoBut was there source-level compatibility with Java?
- cle 10y agoWhat does that have to do with anything? My comment was mainly a protest of what appeared to be Kotlin fanboyism, which I see a lot lately on HN. There is nothing special about these features in Kotlin, they are common features in many popular languages preceding Kotlin, and have been on Java developers' radars long before Kotlin.
- chei0iaV 10y agoMy point is that you can take an existing Java codebase, stick in a Kotlin file, and use those "future Java" features right now, in your Java project. But the fact that those features might have existed in Haskell or Algol68 or whatever is largely irrelevant since we're taking about Java.