3 ms·
Something doesn't add up. First you say (emphasis mine): > Scala compatibility with JVM is the SAME as Kotlin's. Then you follow up with: > Scala has also a
by izolate 7y ago
Something doesn't add up. First you say (emphasis mine):
> Scala compatibility with JVM is the SAME as Kotlin's.
Then you follow up with:
> Scala has also a few more non-Java features
These are contradictory claims. OP had a very good point about Scala being a more powerful footgun. Unfortunately, consciously avoiding features is not a matter of "just", and rarely works out in practicality.
- pkolaczk 7y agoNo they aren't contradictory. What is the compatibility of a feature that even doesn't exist in Kotlin? How can be the lack of way to call a Scala macro from Java a disadvantage, when Kotlin doesn't allow you to call a macro from neither Java nor Kotlin, because this feature doesn't exist? Scala is strictly superior in this case. And you need to avoid some features only in code that gets called from Java, not the whole codebase. Calling it this direction is very rare and not really a problem. Most codebases call Java from Scala and this is easy and fully supported.
- AlphaSite 7y ago100 intercompatiblity is a feature.
- pkolaczk 7y agoBut Kotlin doesn't have 100% interoperability! There are features in Kotlin which don't map nicely to Java features. For example you can't call methods with default arguments from Java without resorting to unreadable hacks relying on a way defaults are implemented (same is true for Scala).