This is only going to get worse after Java 9 and 10 get released.
I imagine by the time we get Java 10, Google might be considering to eventually cherry pick Java 9 features.
They just forked the whole eco-system, and lots of people blindly post links to their Java 8 references, without looking into Android source code, where they are just cherry picking Java 8 features, JVM bytecodes and libraries.
I can understand why they wanted to bootstrap their stuff on top of Java, but now they are clearly not committed to keeping up. And with all of their resources, I just won't believe they can't do it.
JetBrains, as Kotlin steward, takes an effort to have Kotlin work painlessly within Android Studio.
The Scala support for Android apparently only works properly within InteliJ, which means a few versions behind what Android Studio actually supports. It also requires much more configuration steps.
The sbt-android plugin is really amazing. It makes compiling with ProGuard enabled as fast as Gradle without ProGuard, due to the plugins integration of incremental compilation with ProGuard.
Plus, there are quite a few built-in features and "add-on" plugins which enhance the experience further (sbt-android-protify, sbt-android-gradle).
A bunch of people built an "official" website around Scala-on-Android recently, scala-android.org. If you have any questions drop by in the Gitter channel: https://gitter.im/scala-android/sbt-android
Having said all of that, once I got everything working, I felt that using Scala was worth the pain. Programmatic layouts using scaloid gave me a vastly better experience than coding them in XML, and implicits worked really well for passing around the Context object. The tooling just wasn't, by any means, reliable, so I wouldn't recommend it for any apps your career depends on. :)
I haven't tried it, but I've heard that Kotlin is a nice compromise if you're looking for a language nicer than Java with more reliable tooling than Scala.
It's unclear to me whether your pains were specific to Scala on Android or with Scala tooling in general. I'm already familiar with server-side Scala development using IDEA and I'm relatively comfortable with it, so that's not a problem. Is IDEA awful for Android development?
I would say that if you're already familiar with Scala and aren't afraid of getting into the weeds a little bit, you should be fine in the short-term. My personal fear is simply that, especially with Scala 2.12 dropping support for Java 6, Scala development on Android doesn't have a clear future, so as Google changes their build stack, you may find it increasingly harder over time to keep all the tools working.
There is no sense of hurry as 2.11 won't go away and will have a long life.
You can still use Java 6 and Scala 2.11.
It's just that Java 6 will not receive any bug fixes or security updates, and Scala 2.11 will not either. But both will continue to work.
Seems very sane to me.
I didn't.
> will not receive any bug fixes or security updates, and Scala 2.11 will not either
Oh, I'm pretty sure that Scala 2.11 will receive fixes, security updates and even backports of features for a very long time. For example SI-2712 is getting back-ported to Scala 2.11.9 and there's even talk of back-porting it to Scala 2.10.
Maybe we'll see longer support for people who don't migrate (heck, SBT still uses 2.10.x), but justifying it by Java version is weird.
If you're okay with using old Java versions, it's not much of a stretch to say you'll be okay with old Scala versions.
No, because Scala doesn't offer forward binary or source compatibility. Maintainers of widely-used Java libraries can write and build for Java 6 and be confident their libraries will be usable by everyone (on Android and off). Maintainers of widely-used Scala libraries have no such option (for now they can write their code using the subset that works in Scala 2.11 and 2.12 and cross-build, but there's no guarantee that such a subset will be maintained in 2.13 and beyond).
There's no guarantee about Java either. This class compiles with Java 7, but not with Java 8:
class SampleClass {
static class Baz<T> {
public static java.util.List<Baz<Object>> sampleMethod(Baz<Object> param) {
return null;
}
}
private static void bar(Baz arg) {
Baz element = Baz.sampleMethod(arg).get(0);
}
}
Like Java or any other good software, Scala will try to maintain backwards compatibility (particularly source compatibility).Ok, but you can compile it with the newer compiler by passing -source 1.7, right? And you can call into it from 1.8 code?
Thanks for your support!
And GAE standard environment. :(
This is great because the generated bytecode is smaller and more resistant to binary compatibility issues. Scala has had problems with binary compatibility because its features don't map that well on top of the JVM and traits have been very problematic, so thankfully now we have a more efficient encoding. Having SAM support is also good for both Java devs wanting to use Scala libraries and for Scala devs wanting to use Java libraries.
But this also means that Scala 2.11 should be a long-term support version, because even though Java 6 and 7 have reached end of life, the world is not ready to fully commit to Java 8, as sadly there are projects like Android that are holding us back.
Scala 2.12 is a big achievement, with many changes under the hood. I'm happy to finally see it released. Kudos to those involved.