Live data from Hacker News

Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

news.ycombinator.com

21–30 of 203 posts

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#21
post #20

Earlier quoted context omitted.

What was the need that Kotlin arose out of?

To summarize, we were looking for a language that could cut down our code base (IntelliJ platform and server side tools are written in Java), be concise but still expressive, toolable, as fast as Java, easy ramp-up time, and very important, interoperable with all the existing code base we had. Given the candidates at the time, it was decided to start Kotlin.

Based on my admittedly limited experience in the JVM world, your needs sounds like Scala's sales pitch. What factored in to your decision to develop Kotlin, rather than going with Scala?

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#22
post #16
post #5

It is officially supported by Jetbrains. I don't really see it as a full-fledged language but rather an extension of Java. I'm planning on trying out on my next Android app.

In what sense don't you view it as full-fledged?

Java interop is a "first-class" citizen, even more so than say Scala.

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#23
I toyed with Kotlin for Android development. It is very promising. It solves many of my annoyances with Java while keeping what is working.

I work in an 8 engineers Android team, switching to Kotlin for our Android app is not on the table at all though. Our huge codebase and complex build script can't be easily retuned to another language, even one compatible with Java and it is an added liability we don't want to deal with. If Google were to adopt it, it could very quickly gain steam for Android development.

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#24
I have written Kotlin for an Android app now in production. Having written plenty of Java for Android, Kotlin is really good. It feels like Java in some ways, but helps you more than gets in your way. Nullable/non-null features crush NullPointerException, which are the most common and annoying type of run-time error, this is actually a very pragmatic feature for professional programming. Overall it's less verbose than Java. It's not hardcore on functional programming as Scala is, but adds some FP niceties with its standard library, allowing you to use map/filter/reduce/etc functions on Iterables, which matches very nicely with RxJava if your project is using that already. Also, lambdas make it easier to use RxJava. And IntelliJ IDEA's plugin for Kotlin has a button "Convert Java file to Kotlin", which does a fairly good conversion.

The problems I had with Kotlin are minimal. When converting a Java file to Kotlin, I got ClassNameException (I might not remember the name correctly), but you just need to clean and rebuild the project. Lack of support for multiple constructors of a class made me scratch my head, but they added this support in a recent version. Overall Kotlin is a better Java (in less radical ways than Scala). The reason it's feasible for Android is that its size is comparable to small libraries like Retrofit, while Scala is huge and building Android apps together with sbt has been a nightmare for many who tried.

The adoption issue is a chicken and egg problem: long-term viability depends on people adopting it, and people want to adopt tools reliable in the long-term. So just do it. Java sucks anyway, I would do anything not to write it.

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#25
post #8
post #6

It seems that Kotlin will be officially presented as next language for Android. IDEA and Android Studio will receive built-in full support for Kotlin in nearest future. I write some parts of Telegram app in Kotlin. Pretty good after plain java. I can't rely on it in production yet (used in build chain). My feelings that React Native + Kotlin could be awesome combination.

"It seems that Kotlin will be officially presented as next language for Android." Source?

it seems they've already started playing with it https://twitter.com/rosshambrick/status/624431306567385088

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#26
I wrote a small implementation of ListView in Kotlin a while back just to try it out [1]. The pros are pretty cool and some of the issues I mentioned in the readme have been fixed now (multiple constructors).

There are still a couple of issues though:

- Debugger functionality in IDEA (maybe it's been fixed now?). It was pretty unusable last I tried.

- (Android-specific) When extending Android framework classes you don't gain much benefit, since you'll be using the !! operator (override null-safety) a lot, and you'll be somewhat forced into a design pattern that takes away a lot of the power Kotlin offers.

If I were to use Kotlin, I'd use it for helper classes and extend View classes, etc. in plain old Java.

[1] https://github.com/T-Spoon/Kotlist

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#27
After reading Mike Hearn's article on the subject[1], I'm convinced. The next project where I'd normally reach for Java and where I have some freedom in choice of language, I'd pick Kotlin instead.

[1] https://medium.com/@octskyward/why-kotlin-is-my-next-program...

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#28
I have been using Kotlin in production for 2 Android apps since october 2013.

It made things simpler to write, develop and maintain.

One big downside, as of 0.12.1218, is that builds on Android are quite slow (I got 5min builds). But the Kotlin team is aware of the issue and working on it.

Once the kotlin builds on Android get fast enough, it will blow everything else out of the water.

If Google were to switch from Java to Kotlin for android, I wonder how Oracle would feel...

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#29
Yes, I've used kotlin to replace a large legacy Java application. Pretty critical to the business, sat in the middle interacting with. All upstream and downstream systems.

Kotlin certain ly made life easier in some places, most importantly it was fast and easy and a joy to work with.

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#30
post #20

Earlier quoted context omitted.

To summarize, we were looking for a language that could cut down our code base (IntelliJ platform and server side tools are written in Java), be concise but still expressive, toolable, as fast as Java, easy ramp-up time, and very important, interoperable with all the existing code base we had. Given the candidates at the time, it was decided to start Kotlin.

Based on my admittedly limited experience in the JVM world, your needs sounds like Scala's sales pitch. What factored in to your decision to develop Kotlin, rather than going with Scala?

I can't speak for JetBrains, but from my own experience with Java, Scala and Kotlin, Java interop in Kotlin is a lot better. Scala also offers a lot more features than Kotlin, which is great for highly experienced programmers, but usually means having to subset Scala for mixed experience teams. Kotlin seems to strike a better balance in terms of approachability and expressiveness, and hence being better suited for teams of different experience levels.
Post reply on HN