You have to put Java in its historical context to understand how it came to be. It was a mid 1990s over-reaction against the super-complicated, super-fragile software that people were churning out with C++. It was designed as a kind of babytalk that would avoid the complexity of speaking C++. Of course we all know it was an over-reaction, leaving behind perfectly reasonable ideas like multiple return values, lambdas, and unsigned numbers in a kind of French Revolution against C++ silliness.
Scala is also an over-reaction in the other direction. It's like a cross between Perl and one of the more pragmatic ML dialects. It's easy to churn out a lot of Scala code, but hard to read someone else's or debug a Scala program. (Case in point: seeing <anonymous> for every stack frame in backtaces.) Eventually we will want to meet in the middle somewhere with regard to complexity, and Java is best positioned to do that.
It's not about will Java adopt more Scala features, it is about how will it look when it is all glued together. I think for Java it can only go for worse, since language is massive as it is right now. Adding more would only bring more confusion for the table. Also good question is how will it work with other components of same language. I am not programming in Scala, I mostly read about it and read it. Still on faculty, but few older friends of mine, who have finished faculty 3 years ago and started to work at local startup/small company all worked in Scala and they are amazed how good everything goes for the company and that couldn't but notice that "Developer Happiness" factor being pretty high. So all those things considered tells you something...
> It's easy to churn out a lot of Scala code, but hard to read someone else's or debug a Scala program
I see this argument a lot in Internet forum discussions, but I've never met anyone who actually had problem reading production level Scala code more than problem reading Java code. Sure, people love to bring on Scalaz and other extreme type-level coded Haskell-like libraries where things can get hairy, because they're solving a complex problem. These people fail to show Java-equivalent of such complex Scala code, so a conclusion that Scala was complex is invalid.
However, when comparing things solving similar problems for which we have a Java project and a corresponding similar Scala project, let's say Apache Spark and Apache Hadoop, Spark's code wins in readability hands down.
The bottom line is that if you like Scala, you are probably not going to like Kotlin and that's perfectly fine. Kotlin is for everyone else and it seems to be pretty successful with that audience so far.
Using Scala on Android requires a bit more tinkering with ProGuard than Kotlin does, and it isn't a focus of the Scala designers.
Also with Scala 2.12 going Java 8, one will be stuck with 2.11 for Android.
According to Jake Warton, they only cherry picked some parts of OpenJDK 7.
From the commits they also don't appear to ever fully support Java 8, only lambdas.
Also the way they are cherry picking features from OpenJDK 7 and some kind of lambda support.
For me, Android Java has become similar to Symbian C++ in terms of dev experience and language fork.
This is true of any language so it doesn't mean much.
Still, we went through the same thing with C++ 20 years ago. Google even used to have (still does?) a style guide saying which features to use and which ones not to use.
Instead of having to use a guide that tells me which features of a language are dangerous, I prefer a language that doesn't require such a guide in the first place.
I don't think there are any dangerous things you can do in Scala that you can't do in Kotlin. Only safe alternatives that exist in Scala but not in Kotlin.
Which is a good example on how not to write modern C++, given the things they don't allow to use and not loved that much in the C++ community.
It's an incremental improvement over Java and it fixes exactly all the complaints I have over Java and nothing more.
Also, its IDE support is just as good as Java.
But the language is not even out officially, let's see in five years how it fares. Right now, it's just a breath of fresh air over Java.
We're working on gigantic production systems currently and with good modularization compile times are not a problem for us.
It is all about Java, Scala and Clojure.
I don't think one can make any pronouncement about Kotlin's success or failures for several years.
This will of course improve for Kotlin, specially if they get some Google blessing.
EDIT: Also forgot to mention that on Swift's case, it is a first class language being pushed by the platform's owner, not a 2nd class language without any kind of consideration from the platform SDK.
And the fact that 1.0 RC was just released this month might tell you other reasons why. How many Scala jobs did you see advertised when 1.0 was released in 2004?
You can't see a future for a language that offers far more succinct code than Java, but maintains the ease of Java?
`List<Int> myNewList = myList.stream().map(i -> i +5).collect(Collectors.toList());`
In Kotlin:
`val myNewList = myList.map(it+5)`
Can you see how that can be clearer and simpler to read? Technically it is doing the same thing, but it is much simpler to reason with. On top of that, you've got improved null safety, monkey patching and type inference.
That comparison looks misleading - the .stream() and .collect() are conversions, not necessary on every call by any means.
Kotlin's approach to null safety is ad-hoc and integrated into the language in a way that makes it hard to abstract over. I think it will lead to inconsistent code as the JVM ecosystem moves on to make more use of Option-like alternatives.
Monkey patching is pure evil in any large codebase.
I think Java will likely add more and more type inference in future releases.
Don't get me wrong, syntax and sugar are important. But a language that only offers those is probably not worth the overhead, and such things are relatively easy for the "parent" language to adopt.
Besides, it's not any more magical than "_" (which has, what... eleven different meanings? [1]) and it's super convenient. Still, don't like it? Just explicitly name your closure parameter. But you'll be surprised how you will quickly stop doing that for trivial closure uses because finding names is such a pain.
You're right that Java 8 has been closing the gap, though, but note that Java 9 doesn't have any new language features that will close that gap further.
FWIW I avoid "this" as much as possible. I prefer a named self, which Scala has a nice concise syntax for.
> Besides, it's not any more magical than "_"
Like I said, "_" looks like syntax. "it" looks like an ordinary value.
> which has, what... eleven different meanings? [1]
Sort of, but it's always obvious from context. I have literally never been confused by an occurrence of "_" in 3+ years of full-time Scala programming.
You're assuming here that a lot of people have used Groovy. People generally don't even use "it" in Gradle, the most common access people have to Groovy.
You call it hype, I call it enthusiasm.
But regardless of the names we use , what I find very interesting is that Kotlin is generating such positive feelings even though it's not even 1.0. I haven't seen this happen for languages in a while (probably "ever"). What's also striking is that most of what I read about Kotlin is positive, and again, languages hardly ever generate positive feelings so widely across the board.
The positive feelings ring very false to me. Kotlin has announced a lot of features long before they were delivered, and taken a lot longer to deliver a working language than they originally claimed. It's the old "two types of languages" - most languages sound good when you talk about their features, it's only when you actually use them that the negatives become apparent.
I don't know anyone who's actually used both Kotlin and Ceylon and prefers Kotlin, and Ceylon is actually more mature (1.2 released recently, IIRC). But since King only advertises features that are actually implemented and release dates he can actually make, there's a lot more hype for Kotlin.