Hacker News new | ask | show | jobs
by deccanchargers 1863 days ago
As a person who is just starting to learn Kotlin for Android Development, Can you please tell me which language is better to pursue for android development?

I also recently read this https://billthefarmer.github.io/blog/android-kotlin/

adding to dilemma of choice.

4 comments

As someone who's been in that field for the last, uhhh, 8 or 9 years, I'd say feel free to go with Kotlin. You will understand java the moment you see it later on, meanwhile Kotlin is easier to write, understand and think it. It will get you where you want to be faster than Java. All modern examples will be written mostly in Kotlin, so you won't have trouble adjusting. But in the end, just pick one and go with it, being paralysed by analysis won't help you at all, and after you're fluent in one the other will be familiar too.
I have nothing to say about the rest of the article, but here's one bit that doesn't make the point the author hopes for.

> The obvious difference with the app is that the Java version size is 74Kb, the Kotlin version is 781Kb. Rather a lot of bloat for a small simple app.

No, it really isn't. Anything less than one MB is negligible. Importantly, since we have exactly one sample for each we don't know if that's fixed overhead or variable. Does a 5MB Java app become a 5.7MB Kotlin app? Then the overhead is fully fixed and it doesn't matter. Does a 5Mb Java app become a 50MB Kotlin app? That's a problem. The truth is probably somewhere in between.

We don't know because the author made the unfounded statement about bloat with just one data point.

I would like to say Java, but given the way Google stagnates Android Java on purpose, and pushes Kotlin no matter what, Kotlin is the way to go for serious app development.

Then if you want to do anything related to 3D, realtime audio or machine learning, you also need either C or C++, as those APIs are NDK only (OpenGL is actually also available to Java, but Vulkan is the official 3D API since Android 10).

Now if you want to target Android only as hobby, use whatever you feel like.

Kotlin