Tuesday, July 25, 2017

First look at Kotlin

Unless you live under rock, you should have at least heard about Kotlin, the language now official on Android. People bash and bash java these days constantly complaining about its verboseness (but no one type all that get/set methods when you can have your IDE generate it ok?) and just have to invent something else.

Just about every language has to find a new way to spell "function". Well javascript and Pascal uses it directly "function". C does not need it because everything are functions. Scala and Groovy call it "def" and Kotlin calls it "fun". Ok, hope you are having fun with Kotlin. Besides "fun", the Kotlin syntax for other things are quite elaborate.

Ok how do you do a hello world? Sure you can try it right on the browser.

Ok how about outside the browser, ok you need IntelliJ or Android Studio. Waita minute I want general purpose stuff first, sure there is command line compiler. But that's.. for Linux only? See here. In the programming world seems like everybody uses the Mac and everyone despise Windows. Further looking shows that only very recent updates included a Windows install. Still not in the kotlinlang.org page yet. Definitely there was no hurry to support Windows.

Ok just why do we need Kotlin when there is Java for Android?

See the comparison here.

Kotlin offers a ton of new things but is it worth the learning curve.

I believe Java, if used right, serve the purpose of programming Android (and many other things) well. Only thing about Java is it isn't native code and always require the runtime environment, so if you need system level as-fast-as-you-can things you need something else. I am in no hurry learning Kotlin.

No comments: