Live data from Hacker News

Kotlin, the Swift of Android

blog.gouline.net

31–40 of 114 posts

Re: Kotlin, the Swift of Android

#31
post #15

It's an important point in Kotlin's favour that it's developed by JetBrain, the company that makes Google's official Android IDE. If/when Google decides it's time to sanction a Java replacement on Android, the language designed by their tool provider seems like the obvious choice.

Google will probably not be sanctioning a replacement for Java on Android for quite a while, which doesn't prevent Kotlin from being a very, very good second language for the platform.

One of the main advantages of Kotlin over Scala on Android is that Kotlin is a small increment over Java with very little jar size and language overhead.

Re: Kotlin, the Swift of Android

#32
post #15

It's an important point in Kotlin's favour that it's developed by JetBrain, the company that makes Google's official Android IDE. If/when Google decides it's time to sanction a Java replacement on Android, the language designed by their tool provider seems like the obvious choice.

That's putting the cart before the horse. Google's already shown with the Dart project that they're willing to invest in building tools for their own technology. Android Studio hasn't been the official Android IDE for very long either.

Since it's not 1.0, one could argue it's not even the official Android IDE yet.

Re: Kotlin, the Swift of Android

#34

I've been looking a lot at Scala and kotlin recently. Other differences aside, Kotlin has an 800kb runtime compared to Scala 2.11's 11mb runtime. That's quite a difference

How do you come up with 11 MB?

Even the whole library jar file which is much more than just the runtime is only 5.5 MB.

But even then it doesn't matter anyway. Android apps are ProGuarded before deployment (regardless of the language used) and the overhead in Sclaa's case is a few dozen kBs.

Re: Kotlin, the Swift of Android

#35
post #7

I have been fiddling with Kotlin for last few days. It is trivial to get it working in Android Studio, which is a plus already. It's not nearly as verbose as Java, and for one thing, it gives me LINQ that I've been missing from C#.

For C# devs, Xamarin is a good choice I believe, despite being paid.

I've had opportunity to play with it (at work), but given the price, not a likely choice for my hobby projects. It's not without its drawbacks, either. Since it's not native development (for Android), we 'e adding more moving parts into the equation.

And, for instance, most of the sample apps for Xamarin.Forms wouldn't even build when I tested Xamarin.

I had to fix folder paths (to Android SDK) manually.

The product is superb, but Android is under rapid development and Xamarin folks will always have to play catch up with them.

And in meantime, weird things - all sorts of incompatibilities - are bound to be popping out.

Re: Kotlin, the Swift of Android

#36
post #26
post #21

Earlier quoted context omitted.

Minor correction. We don't make Android Studio. Android Studio is based off of the IntelliJ IDEA platform, which is what we develop.

Oh, thanks for the correction. I had assumed that JetBrain develops Android Studio and Google just puts their stamp on it.

Well that pretty much is what happens. JetBrains wrote IDEA and the Android support for it. Google made some small modifications (some good, some detrimental), and packaged it with the Android SDK.

The biggest change was to switch to gradle which is a more powerful build system but also much buggier (at least in the current Android Studio). They also lots of useful Android-related tools and lints, and a fair helping of UI bugs.

Still, beats Eclipse by a country mile.

Re: Kotlin, the Swift of Android

#37
post #6

Earlier quoted context omitted.

I gave up trying to set it up for Android. It just sucks, and there is nothing but random blog entries on how to get it done. If someone pointed me to reliable resources on how to get it to work, I'd appreciate it very much (as I like the language itself)

Have you looked at the usage guides for the various plugins [1][2]? [1] https://github.com/jberkel/android-plugin/wiki/getting-start... [2] https://github.com/pfn/android-sdk-plugin#usage

I can't remember anymore what I tried and what I didn't :) At the end, I mostly tried not to bang my head against the wall.

Anyway, even your second link stresses: "The primary IDE recommendation is IntelliJ, not Android Studio nor Eclipse". My IDE of choice is Android Studio, and it not being particularly recommended is a red light to me already. Maybe I'm just traumatized.

I'm surely lazy. I wish Google made Scala support for Android official and integrated it seamlessly.

Re: Kotlin, the Swift of Android

#38

It would be nice if more of this was folded into Java itself, rather than existing as a new language - as the author notes a lot of it is in Java 8.

Kotlin has stuff that's unlikely to appear in Java, such as reified generics - Java has already chosen type erasure generics instead. I wouldn't bet a penny that they ever change this approach if they didn't go with it from the start.

Re: Kotlin, the Swift of Android

#39
post #15

It's an important point in Kotlin's favour that it's developed by JetBrain, the company that makes Google's official Android IDE. If/when Google decides it's time to sanction a Java replacement on Android, the language designed by their tool provider seems like the obvious choice.

It's not only about Android. Kotlin is one of the few languages that's developed hand in hand with IDE support. That means you've got Java-class IDEA support for the language, including (interestingly) a Java to Kotlin converter tool! It's not like many languages where you end up having to sacrifice all your nice refactoring tools and libraries to use it. For this reason alone Kotlin is a natural upgrade path for man…

How is the Eclipse support coming along?

Re: Kotlin, the Swift of Android

#40
post #15

It's an important point in Kotlin's favour that it's developed by JetBrain, the company that makes Google's official Android IDE. If/when Google decides it's time to sanction a Java replacement on Android, the language designed by their tool provider seems like the obvious choice.

It's not only about Android. Kotlin is one of the few languages that's developed hand in hand with IDE support. That means you've got Java-class IDEA support for the language, including (interestingly) a Java to Kotlin converter tool! It's not like many languages where you end up having to sacrifice all your nice refactoring tools and libraries to use it. For this reason alone Kotlin is a natural upgrade path for man…

By the way, this converter is not without flaws. Eg. if you convert an Activity written in Java to Kotlin, method signatures do not match (because in Kotlin it should be Bundle? instead of Bundle and so on, since they are all nullable), and that results in baffling error messages that you're trying to override non-existent methods, it's not easy to figure out what's wrong.
Post reply on HN