7 ms·
Scala is usually omitted for one reason or another when Kotlin is compared against Java as a better alternative, which is a shame.
by halfmatthalfcat 5y ago
Scala is usually omitted for one reason or another when Kotlin is compared against Java as a better alternative, which is a shame.
- aero142 5y agoScala has to the solution to every problem except the problem of too many features.
- AzzieElbab 5y agoMaybe but scalas case classes are super easy to grasp and require no magic like annotations
- xenomachina 5y agoWhat annotations are you referring to?
- scubbo 5y agoI'm not the person you were asking, but, presumably, Lombok's annotations.
- AzzieElbab 5y agoLomboks. Seriously, scala case classes are like the very first thing people start using when learning the language. Scala3 enums are even more straightforward
- xenomachina 5y agoThe ancestors of your comment mention Kotlin, not Lombok, which is why I asked. Kotlin's data classes are probably the analog to Scala's case classes, and they do not require annotations.
- ernst_klim 5y ago> except the problem of too many features Scala is a pretty simple, concise and coherent language though. Never understood why people deem it has too many features, I write it professionally and never felt so. At least comparing it to C, C++, Python. Java may be more simple, but you have tons of features added with metaprogramming via dozens of annotations generating lots and lots of boilerplate, Lombok and Spring are examples of that.
- kerblang 5y ago> Never understood why people deem it has too many features I'll start with one (key)word: `implicit` I agree with your distaste for metaprogramming though.
- ernst_klim 5y ago> I'll start with one (key)word: `implicit` I don't think implicit counts as "too many features" or as something complex. Basically all it does is finding a canonical value in scope for a hole of certain type.
- kjeetgill 5y agoI only worked in Scala briefly so maybe it's coming from Java habits, but implicits were huge pain. When first reading through code you don't really know if that function call you eyed over really has the params you think it does. It makes it WAY harder to track what's derived from what. Either way, the local Scala guru there said the Scala community was starting to get over implicits.
- valenterry 5y agoI think that's were it comes from: people that briefly worked with Scala in the past. At some point it was true, but nowadays the problem is solved because IDEs will show you were an implicit is used and where it comes from. Without that, it was indeed more difficult - but also not more difficult than Java's reflection or DI (where you had and have even less help).
- adambatkin 5y agoLombok and Kotlin are both much easier to integrate into existing Java applications and libraries than Scala.
- krzyk 5y agoLombok is the problem not a solution (see https://github.com/projectlombok/lombok/issues/2681 https://github.com/projectlombok/lombok/issues/2681 regarding support for JDK 16 to understand why) and a ticking time bomb in every project that wants to move past JDK 15/16. But why do you think Kotlin is easier to integrate than Scala? Both work on JVM.
- gher-shyu3i 5y agoIt's been resolved though.
- kelnos 5y agoI don't see how Kotlin is easier to integrate into an existing Java app than Scala is. They both require adding new dependencies and changing your project build config, and require developers who know the respective new language. That's... about it. They both offer similar levels of interop with Java libraries. If you want to assert that finding Kotlin developers is easier or that Kotlin is an easier language to learn, sure, that might be the case (I really don't know), but that's not really an integration task.
- throwpupper 5y agoWhat about the fact that Kotlin collections are fully interoperable with Java collection? That makes the transition significantly easier.
- halfmatthalfcat 5y agoI believe Scala's are as well, this seems to be a pretty complete list: https://www.scala-lang.org/api/2.13.5/scala/jdk/javaapi/CollectionConverters$.html https://www.scala-lang.org/api/2.13.5/scala/jdk/javaapi/Coll...
- MichaelMoser123 5y agoi think Kotlin might be winning over Scala because of better ineroperability with java. https://jelmini.dev/post/java-interoperability-kotlin-vs-scala/ https://jelmini.dev/post/java-interoperability-kotlin-vs-sca...