News for hackers. Stuff that matters.
Re:Kotlin is now Google’s preferred language for Android app... by mcv on Wednesday May 08, 2019 @08:15AM (#19858076)
This is nothing new. People were constantly introducing new languages back in the 1990s too. Of your preferred languages, Rust and Typescript are fairly new. They are among the success stories of this tower of Babel.

There's a constant churn of replacing and improving languages. Nobody is using Algol, Pascal or Smalltalk anymore, and even COBOL is losing ground. (Only Lisp and C seem to survive everything.) There's a constant process of learning and improving, that resulted in this latest generation.

And every language is good at something that no other language is good at. There are good reasons why some people prefer Perl, Python, Javascript or C for some tasks. Kotlin is rising in popularity because it's turning out to be the better Java that Groovy and Scala weren't.

Expecting everybody to use the same programming language for everything is like expecting a carpenter to choose a single tool to use for everything. And maybe a Swiss army knife really can do it all, but still not as well as a more dedicated tool.

Re:Kotlin is now Google’s preferred language for Android app... by dvfjsdhgfv on Wednesday May 08, 2019 @09:54AM (#19858810)
> Kotlin is rising in popularity because it's turning out to be the better Java that Groovy and Scala weren't.

I'd say Kotlin is rising in popularity mainly because it's a Java alternative backed up by Google.

Re:Kotlin is now Google’s preferred language for Android app... by cloverich on Wednesday May 08, 2019 @10:26AM (#19859072)
Backing by Google has helped, but I honestly think the two main reasons its succeeding are the same two reasons Typescript is succeeding: A "better" language that's "pragmmatic". What i mean is, they both provide the features people want (types, inference, less verbose than Java) and have quality out of the box tooling (because Jetbrains and vs-code). The moment I saw and tested either, I knew they would be a smashing success because they solved the problems people wanted solved, and "just worked".
Re:Kotlin is now Google’s preferred language for Android app... by vorg on Wednesday May 08, 2019 @07:09PM (#19863814)
The rise-and-fall adoption of Scala and Apache Groovy is because their whole rationale for existing was to be a better something. Groovy (2003) tried to be a better Beanshell (1998) by adding closures to it. Beanshell tried to be a better Java (1995) by adding dynamic typing to it. Scala (2003) tried to be a better Java by adding definable operators to it. But when something even better comes along, their rationale for existing disappears. They will try to catch up by adding features later (e.g. Groovy 2's inferred typing to compete with Scala, or its more recent macros to compete with Clojure) but by then the newer language has made a foothold, and it's too late.
Re:Kotlin is now Google’s preferred language for Android app... by pkolaczk on Friday May 10, 2019 @11:04AM (#19878451)
> Scala (2003) tried to be a better Java by adding definable operators to it.

That's totally wrong. The reason d'etre of Scala is merging FP and OOP in a simple and elegant way. And actually there was no "fall" in rise-and-fall adoption of Scala. The adoption is growing.

Re:Kotlin is now Google’s preferred language for Android app... by mcv on Thursday May 09, 2019 @07:13AM (#19867094)
I think it's not just that Groovy and Scala were temporarily a better Java that was eventually overtaken by the next even better Java, I think they were not sufficiently better. Better at some things, but with a cost not everybody wanted to pay. Groovy doesn't perform the way Java does, Scala is fast, but is a lot more complex and occasionally hard to read.

I haven't really tried Kotlin yet, but my impression is that it improves a lot on Java without any real downsides. It might not have all the improvements that Groovy and Scala offer, but it has the most important ones.

And it's a clean slate that leaves some of the poorer decisions in Java behind it.

Re:Kotlin is now Google’s preferred language for Android app... by zmmmmm on Thursday May 09, 2019 @07:17PM (#19873451)
> Groovy doesn't perform the way Java does, Scala is fast, but is a lot more complex

That's not quite how it seems for me. Groovy is faster than Scala in my hands (using CompileStatic) but its main challenge is complexity. It introduces a thousand quirks that have to be learned and then managed. There are some terrible legacy choices that can't be changed (eg: implicit coercion to Strings). I think this is behind the antipathy you see with people like Gradle users and Jenkins users that are incidentally exposed to it. But it applies also when you use it as a "replacement for Java". It has so many useful built in features but the price of that is all the implicit behavior of all of those need to be learned, along with actually learning Java really well, and with that along with less than perfect IDE support, and it's a steep steep curve.

Re:Kotlin is now Google’s preferred language for Android app... by vorg on Friday May 10, 2019 @01:08AM (#19875220)
Kotlin's main improvement on Java is its seamless integration with the most popular IDE on the JVM. Of course, it helps that IntelliJ and Kotlin are put out by the same company, but Jetbrains did emphasize when they first announced Kotlin that its integration with IntelliJ would be top priority. Groovy and Scala never had this improvement.
Re:Kotlin is now Google’s preferred language for Android app... by pkolaczk on Friday May 10, 2019 @10:57AM (#19878375)
Yet, Scala has much better and broader IDE support than Kotlin these days. There is first-class support in IntelliJ IDEA, Eclipse and VS-Code, and with advent of Scala 3 the IDE story is going to be even better with full LSP support, so any IDE or editor could get accurate type-aware highlighting and autocomplete for virtually free.

Kotlin has good support only in IDEA and JetBrains said they wouldn't support other IDEs. They seem to make exactly the same mistake as Scala 2 did with supporting only one IDE initially (Eclipse).

Re:Kotlin is now Google’s preferred language for Android app... by mcv on Friday May 10, 2019 @01:31PM (#19880132)
If that's true, then Kotlin is successful despite its lesser IDE support.
Re:Kotlin is now Google’s preferred language for Android app... by pkolaczk on Friday May 10, 2019 @04:10PM (#19881748)
Main reason for Kotlin uptake is Android. Kotlin is successful due to smaller footprint of its runtime lib and just-slightly-better Java philosophy, because it uses Java collections instead of bringing its own like Scala did. A big runtime library and problems caused by high method count hitting limits of Android runtime slowed down adoption of Scala on Android and allowed Kotlin to take that niche. Later the official support from Google reinforced its position.
Re:Kotlin is now Google’s preferred language for Android app... by mcv on Friday May 10, 2019 @01:32PM (#19880149)
> Kotlin's main improvement on Java is its seamless integration with the most popular IDE on the JVM.

Did Java not have seamless integration? I thought several IDEs (Eclipse, Netbeans and IntelliJ) were designed specifically around Java.

Re:Kotlin is now Google’s preferred language for Android app... by jordanpg on Wednesday May 08, 2019 @11:42AM (#19859930)
I think the rebranding of Intellij IDEA as Android Studio in 2013 was a good clue of where Google's long term plans were pointed.
Re:Kotlin is now Google’s preferred language for Android app... by ionised on Thursday May 09, 2019 @07:36AM (#19867218)
It's not a rebranding. IntelliJ IDEA is still IntelliJ IDEA and is still owned by Jet Brains.

Android Studio is just Google's own version of it.