3 ms·
Surely, you must be joking? Scala is much closer to C++ than Java, forget Kotlin. It is a kitchen sink with every feature under the sun.
by divs1210 8y ago
Surely, you must be joking?
Scala is much closer to C++ than Java, forget Kotlin. It is a kitchen sink with every feature under the sun.
- pkolaczk 8y agoThen how come most Scala code can be translated to/from Kotlin or Swift with just find-and-replace? https://hackernoon.com/how-i-ported-10k-lines-of-scala-to-kotlin-in-one-week-c645732d3c1 https://hackernoon.com/how-i-ported-10k-lines-of-scala-to-ko... The syntax of both is extremely similar. https://leverich.github.io/swiftislikescala/ https://leverich.github.io/swiftislikescala/ Basically Swift and Kotlin based their syntax exactly on Scala. > It is a kitchen sink with every feature under the sun. You obviously don't know Scala and you're just repeating BS found on the Internet. Scala is a much more powerful and much more abstract language than Kotlin, so comparing their syntax complexity is unfair from the start. But if you restrict the problem space to what can be covered by both Scala and Kotlin, then Scala has in fact fewer features than Kotlin. It just happens to have a few more generic, and very powerful unique features, which might look unfamiliar to Java programmers. Examples: * Kotlin has special syntax for null-checking. Scala has no special syntax and implements the same feature in the standard library. * Kotlin has special syntax for coroutines. Scala achieves the same with a library. * Kotlin has special syntax for extension methods. Scala doesn't provide special syntax for extension methods - they can be created with implicit objects which are a much more generic feature and have other important use cases not possible in Kotlin nor Java. * Java has special syntax for array access. Scala does not. * Java has special syntax for interfaces with method implementations. Scala does not. * Java has static members which are completely alien to OOP. Scala does not. * Kotlin and Java have operators, and Kotlin has operator overloading (just like C++!), making operators second class citizen. Scala has just method names, so "operators" and regular methods are the same. > Scala is much closer to C++ than Java Only in terms of abstraction power (IMHO it is much above C++ in abstraction power; actually much closer to OCaml than C++), but not in terms of complexity. Scala language specification is ~200 pages long. Java is ~750 pages, C++ is ~1300 pages.