5 ms·
Is there anybody switching from Scala to Kotlin?
by dxxvi 10y ago
Is there anybody switching from Scala to Kotlin?
- runT1ME 10y agoI can't imagine anyone who has used Scala for long would switch to Kotlin. Kotlin is 'Java++'. Scala is a fully featured functional language. Kotlin is missing all of the most powerful Scala features. No type classes, monadic comprehension, higher kinded types, adhoc polymoprhism. :(
- Apocryphon 10y agoNot everyone needs a functional language.
- V-2 10y agoWell, it's kind of the point. Kotlin is supposed to be light weight and easy. Besides, using Scala for Android, while possible, is cumbersome. Kotlin wins this one hands down.
- simono 10y agoWhich issues did you experience?
- lmm 10y agoScala for Android is fine. The only thing that makes it harder than Kotlin is JetBrains disingenuously shipping their Kotlin plugin but not their (more popular) Scala plugin by default, which they could fix tomorrow if they wanted to.
- V-2 10y agoLast I checked, Kotlin plugin isn't installed (in Android Studio) by default. Are you referring to IntelliJ Idea? I tried to use Scala for Android in the past and I gave up after attempting to set it up for a few hours. Admittedly it was a while back, perhaps things have improved. Your claim that Scala on Android works fine got me interested again, so I googled around, found that blog post from May this year (that's more recent than my own experiments), and apparently there are still hurdles: http://blog.scalac.io/2016/05/19/reflections-on-starting-android-project-with-scala.html http://blog.scalac.io/2016/05/19/reflections-on-starting-and... With this type of issues the thing that I'm wary about is not getting a "hello world" app to compile once, but that I can get a project up and running, then need to add something else to the equation (say, a DI, or some code processor), and things fall apart again in an X-Files fashion. I've heard that Scala has long build times, too, but maybe it's a thing of the past as well - no first-hand experience here as I never got to that stage.
- simono 10y agoThe article isn't very good, even the link to the 'official' page is outdated. Just use sbt-android and skip all the other nonsense. Compilation is impressively fast, as the plugin uses the information from incremental compilation to skip ProGuarding completely for things that haven't changed.
- relics443 10y agoIf they're using it for Android development they should. Kotlin has just about first class support for it, while Scala is a pain to get working.
- hota_mazi 10y agoAlso, the latest version of Scala doesn't work on Android since it requires Java 8.
- simono 10y agoWhich issues did you experience?
- pjmlp 10y agoKotlin: 1 - Install plugin into Android Studio 2 - Configure the Gradle plugin Enjoy Android development within Studio. Scala: Follow this several pages long tutorial: https://www.voxxed.com/blog/2016/10/setting-up-scala-on-android https://www.voxxed.com/blog/2016/10/setting-up-scala-on-andr... Try to enjoy while working around issues with Studio integration and common Android libraries.
- simono 10y agoI wonder how people come up with these pointless, overcomplicated tutorials...
- gregschlom 10y agoAfter having so much fun with Kotlin, I tried switching to Scala and quickly switched back. Scala seems too complicated, with a steep learning curve. Implicits all over the place made it hard to read code and understand what was going on. I do like many of the more powerful features that Scala has, but Kotlin strikes a right balance of simplicity and power in my opinion.
- runT1ME 10y agoAs a really big Scala fan, I can say Kotlin is probably the right choice when it comes to doing Android development. That being said, yes Scala has a steeper learning curve than say, Kotlin or Go. But if you're going to devote the I don't know, next ten years of your life to working in a particular language, does it really matter if it takes two months vs. four months to ramp up?
- deleted 10y ago[deleted]
- mhd 10y agoIn the mobile space, I see a lot of "also ran" languages, never mind the platform. I don't think people who wrote iOS apps were much intent on using Objective-C outside of that, and I don't think Swift will improve much on this. A lot of Android developers fall into the same niche: They're using Java because they have to, not because it's their major background. So anything that makes their side errands into Android-land easier is welcome (cf. react-native). Plenty of "ok-ish, but not too hard to learn" languages proliferate in that kind of climate, like go for small web services (where Erlang was too much of an investment). The Unix approach of 1001 ad hoc sub-languages (awk, pic, ed...) adapted. Quite different from e.g. a J2EE developer's approach, who tends to think of career-defining technologies and languages, where Scala seems like a wise investment.
- zem 10y agoi think redhat's ceylon strikes my personal sweet spot between java and scala, but kotlin is a great language too.
- cryptos 10y agoI've used both, Scala and Kotlin, and I like Kotlin very much. A programming with more features is not necessarily better. The limited features of Kotlin (compared to Scala) are an advantage, if you change your point of view. Some advantages: * easier to learn (a Java dev will be more productive than in Java in a day or two) * easier to maintain since Kotlin doesn't allow so much hard to understand code constructs * fewer discussions about the one true style or way to do something * it's easier to build good tooling * much faster compilation * smoother Java interop * performance implications are more predictable