3 ms·
Having to work with Optionals in Kotlin means just using their Java API. Having to work with Scala collections means having to convert them back and forth every
by royjacobs 9y ago
Having to work with Optionals in Kotlin means just using their Java API. Having to work with Scala collections means having to convert them back and forth every time you interop with Java. The performance implications of the latter are much higher.
- simon_o 9y agoThe ironic thing us that Scala could have just implemented java.lang.Iterable and/or java.util.Iterator, instead of rolling their own interfaces with largely the same methods with identical signatures.
- lmm 9y agoAlmost all JVM projects are much more tightly constrained on development time than on compute time - and those where compute time is the limiting factor are unlikely to consider either Kotlin or Scala. But in the vanishingly rare case where you have a performance-critical codepath that needs to zigzag back and forth between Java and Scala... it's still not a problem, because it's easy to work with the Java collections in Scala. The absolute worst case is "just using their Java API" (the same thing you dismiss about using Optionals in Kotlin). But since Scala has typeclasses we can actually do much better than that.