10 ms·
Kotlin is now Google’s preferred language for Android app development
- maga_2020 7y agoI feel good and bad about this. I invested several years at coming up to speed with Java 8+ (using templates, rx, streams, the new time APIs). It was not hard, but difficult to unlearn some C++ idioms around templates, consts, reference model and object lifecycle management. Clearly this driven by Oracle's continuous poisoning of Java ecosystem (eg https://headcrashing.wordpress.com/2019/05/03/negotiations-failed-how-oracle-killed-java-ee/ https://headcrashing.wordpress.com/2019/05/03/negotiations-f... ) And I think Kotlin is a solid step forward from the Java without the baggage of pre JDK 1.7 idioms. But for a small (often single dev) shops trying to compete in Android marketspace, it is quite hard to maintain this rate of change (plus incorporating all the new (and better ways) of doing android with androidx )
- EdwardDiego 7y agoNot sure what you mean by templates, but you can still use Rx, streams and java.time.* in Kotlin. It's pretty much just a nicer Java.
- vbezhenar 7y agoKotlin has its own (much better IMO) alternative to streams: Sequence. I see absolutely no reason to use streams in Kotlin.
- sievebrain 7y agoThe Java 8 streams library can auto parallelize things. That's the main reason it was created in fact!
- elcomet 7y agoOne simple reason: you already know streams and don't have time to learn sequence.
- ptx 7y agoStreams is mostly just Java's version of what many languages already had, so the concept was something new to learn for Java developers, but once they know it they shouldn't have much trouble with Kotlin's sequences – or with Python's list comprehensions, Lisp's mapcar, and so on.
- EdwardDiego 7y agoSure, but the point is, you can.
- tracer4201 7y agoI’ve seen that article you linked to before. Is the solution to working around Oracle not OpenJDK? I’m not completely informed on the topic. Would appreciate some more context.
- pjmlp 7y agoUsually FUD against Oracle, that always ignores that Oracle is also the major company behind OpenJDK. Until there are other companies actually implementing JEPs into OpenJDK in the same volume as Oracle, OpenJDK == Oracle.
- scns 7y agoDidn't Red Hat take over recently?
- pjmlp 7y agoRed Hat has taken over the maintainance of the already released Java 8 and Java 11, LTS versions, not development of new features. This is a now somewhat outdated report of contributions per company to OpenJDK. https://blogs.oracle.com/java-platform-group/building-jdk-11-together https://blogs.oracle.com/java-platform-group/building-jdk-11...
- threeseed 7y agoIf Oracle was really intent on poisoning Java then they would've stopped investing in it and fired all of the core engineers. But they didn't. And have in fact continued to invest in the ecosystem e.g. GraalVM, OpenJDK.
- sonnyblarney 7y ago'Poisoning' is not 'getting rid of'. 'Poisoning' is taking full control and monetizing everything, making everything closed source. GraalVM is in their eyes, going to be a money-making investment. The only extent to which it might be partly OSS is a function of how much they really had to give away. Oracle's objective with Java is to take a huge bite out of the Enterprise and do with Java what they did with their DB. Imagine if we all needed to talk to an Oracle sales person to make our app :)
- dragandj 7y agoYou mean like you have to be a registered Apple developer to sell your iOS app in their app store which captures 99.99% of the market? Java is, fortnately, out of Oracle’s reach unless your company is actively looking at “enterprisey” solutions, but in that case it probably makes more money from that sort of deals than it is paying to Oracle, so it’s all good...
- apta 7y ago> making everything closed source. Except the JDK is now fully open source. Even previously closed source JDK projects are now open source.
- eatonphil 7y agoNot sure why they don't link to a source on this. Here's what I found [0]. It says: > If you’re starting a new project, you should write it in Kotlin [0] https://android-developers.googleblog.com/2019/05/google-io-2019-empowering-developers-to-build-experiences-on-Android-Play.html https://android-developers.googleblog.com/2019/05/google-io-...
- pjmlp 7y agoGood that they cleared that out. Lets see what is the roadmap to use Java 9+ libraries in Android, or if they are supposed to be all rewritten in Kotlin. Secondly, will they also replace NDK with Kotlin/Native? Given that several APIs are NDK only, and naturally should be accessible to the prefered language as well, without manual boilerplate.
- benjymo 7y agoI don't think they should be rewritten in Kotlin. That would force everyone to use Kotlin with minimal benefits for Kotlin users.
- liopleurodon 7y agoMight have less to do with users and more to do with Oracle v Google
- pjmlp 7y agoI am fine with Google having their own ".NET", at least it isn't Google J++ anylonger.
- pjmlp 7y agoJava 9+ is not supported on Android, so if you want to link to a Java 9+ library for an Android application, your only path is to rewrite it in Kotlin, as it is clear from this announcement that Google won't bother to add the required machinery to ART to support Java 9+ class files and new libraries. Naturally the other alternative would be to downgrade the code back to Java 8, but then the question remains for how long they will keep it around.
- nnq 7y ago...great, Kotlin for Android, Dart for Flutter, on the ML side they're starting to adopt Swift, for networking infra code Go. What the heck is with this "tower of babel"?! Are other people not bothered by the overlapping features of all these languages? At this point I thin most would prefer a slightly-frankensteinian monster-language that you'd get by taking either Kotlin or Swift and bolting all the other features on top of it. There should be an estimate about the cost of all this useless diversity that we're all invisibly paying. Some tech/languages have really unique features, and have a reason/right to exist, eg. Rust. But most would've been better as extra features bolted on top another language. Basically all programming in the world could be done with 3 languages: a secure system language (Rust?), a dynamic but optionally typed dynamic one (Typescript?), a full-spectrum metal-to-abstraction language with flexible compiler/infra for things like heterogeneous (CPU+GPU+TPU+whatever) code generation (C++? D? Swift? Julia? maybe also Rust?). Plus the hidden cost of security issues created by people coding in languages they are not experts in because they need to always switch...
- daef 7y agothinking about nim(rod) I'm quite happy that there are still ppl trying out stuff.
- amanzi 7y ago> ...great, Kotlin for Android, Dart for Flutter, on the ML side they're starting to adopt Swift, for networking infra code Go. Don't forget HTML+JS+CSS for websites and PWAs. And given that web technologies work across all platforms, perhaps that's the area for developers to keep focusing on.
- gridlockd 7y ago> And given that web technologies work across all platforms... This is a myth. Web technology is more "Write Once, Debug Everywhere(tm)" than Java ever was. The real value is in deployment, bypassing all the platform bullshit. It's still a severely limited platform and will probably remain so, because Apple has no interest in giving up its walled garden.
- 7y ago
- BossingAround 7y agoIt seems to me that a lot of people seem to think prefering Kotlin signifies a move away from Java. But I simply don't understand how using a JVM language signifies a move away from Java. After all, it all gets compiled into the same bytecode, and Kotlin heavily depends on the Java ecosystem. If Oracle is 'poisoning Java', Kotlin's not the answer. Surely, it'd be a language totally independent of Oracle, wouldn't it?
- vitoreiji 7y agoI bet they have plans to make a different VM for Kotlin and move away from JVM, should be coming in the next couple of years.
- ForHackernews 7y agoWhy bother? Being on the JVM has many advantages and building some new VM (and compiler?) would be extra hassle and expense for not much gain.
- PunchTornado 7y agomoving away from oracle is `not much gain`?
- ForHackernews 7y agoThere's already at least two big-name alternatives to Oracle Java: The OpenJDK and Amazon's Corretto. If you're suggesting Google might make their own "supported" OpenJDK build, then sure, that might be worth something. That's different than moving away from JVM entirely to a different compiler target, as suggested by the parent comment.
- pjmlp 7y agoOpenJDK is like 90% developed by Oracle with smaller contributions from other partners in the Java community, including the JEPs that bring Java forward.
- deleted 7y ago[deleted]
- _Codemonkeyism 7y agoLove the JetBrains people, thanks for all their work and putting their IDE language knowledge into a programming language - that's also I assume easy to parse and support in an IDE.
- stunt 7y agoI thought it was already Google's preferred language. I remember they announced that some time ago.
- fithisux 7y agoSo, now we should all start using Kotlin because Google uses it. Great! (Pun intended of course).