4 ms·
Kotlin (which I don't know) looks a lot like Scala (which I do), at least superficially. Wonder if you've had any experience with Scala to compare the two?
by commandlinefan 7y ago
Kotlin (which I don't know) looks a lot like Scala (which I do), at least superficially. Wonder if you've had any experience with Scala to compare the two?
- Filligree 7y agoScala is way more complicated. I don't know if that's an advantage or not -- I never got far enough into learning it to do a valid comparison. Kotlin code is something any Java programmer can read with just a few days learning, however.
- tlarkworthy 7y agoI did Scala first, then recently took over a codebase with both. I think the people who did Scala were not good and they made a total mess, however, their Kotlin miscroservice was actually quite nice and was the best code in the project. So I reluctantly have concluded Kotlin is a better level of expressivity. Scala is full of footguns... I love it ... but it's hard to write well. One example was they were using enumerations and got boxed in. They had to add unit tests to ensure they enumerated all the options. Why does Scala have that feature? It's full of bad features you should avoid.
- manojlds 7y agoI have been using Scala in Production for 5 years - microservices to streaming to batch jobs. I recently started working on Kotlin. Kotlin is the better Java than Scala and is much easier for someone to pick up. And like you mentioned, Scala is very easy to mess up. Scala the good parts is tough to initially identify and work with, and one might as well pick up Kotlin if they are not into functional programming.
- cryptos 7y agoI have the same experience. Once you do more with Scala than "better Java" it is easy to create a mess full of "try to be clever" code you will regret a year later. It is really hard to become a good Scala programmer, but it is not hard to become a good Kotlin programmer. All the little things that make Scala theoretically better are not worth the learning effort. In Kotlin you get 80 % for 20 % of the effort. Scala is separated in subcultures. Some developers use it as "Haskell for the JVM" and other as a "better Java", or something between. That makes hiring and picking up existing projects hard. Tooling is another weakness of Scala. Scala IDE (Eclipse) is more or less dead. IntelliJ with the Scala plug-in is ok, but the Kotlin support is much better.
- eugen_a 7y agoTo sum up my experience: Scala can be even more terse than Kotlin, but I found Scala code generally harder to read and understand compared to Java. It has the kitchen sink thrown in in terms of features and the idiomatic way of writing code is pretty complex and very different from Java. Kotlin on the other hand is just a breath of fresh air, very easy to pick up and get productive. I just hope they keep the language to a manageable size and don't keep putting things on top.
- ayberk 7y agoUsed Scala in production for two years and have been writing Kotlin for a year now. I'd still prefer Scala to Kotlin any day as I still think it's a stronger language. We had to use arrow library to make Kotlin more like Scala. Especially if you're leaning more functional, standard Kotlin will be lacking. That being said, Kotlin's entry point is much much lower for Java programmers. Kotlin is a better Java, so I can understand the appeal. I'd never start a new project in Java when Kotlin is available.
- nine_k 7y agoScala is like C++: powerful, unkempt, and has a number of footguns built in. It has naturally evolved. Kotlin is like Clojure, or Elm, or Rust: it is lean, orthogonal, and thought out. It has been intellijently designed. My choice is firmly behind designed languages.
- pkolaczk 7y agoKotlin is less orthogonal than Scala. For example nullability in Kotlin is a special language feature that can't be abstracted nicely, when in Scala it works just as any other monad. Also I don't agree it is like Rust or Closure. Kotlin got majority of features from Scala, and contrary to Rust or Scala it does not offer anything innovative. Kotlin is just Java with nicer syntax. Scala and Rust are more complex, but these are the few that move the needle.
- joostdevries 7y agoI've developed in Scala for 5 yrs, last yr in Kotlin. Scala spearheaded from 2007 a lot of features that nowadays are the norm for statically typed programming languages. Odersky is a visionary imo. For a while I experienced Kotlin as Scala--. (No pattern matching?!? ) A bit later I discerned where Kotlin is treading its own path. The biggest things for me are: non monadic approach to async. Which works really well. And simpler extension functions. I'm looking forward to trying out union types that are coming to Scala.
- mrkeen 7y agoIt misses higher-kinded types and for-comprehensions. So you cannot generalise List<X> as L<X> nor pull out its values with x<-lx.