Live data from Hacker News

Learn Kotlin in Y Minutes

learnxinyminutes.com

21–30 of 239 posts

Re: Learn Kotlin in Y Minutes

#21
post #16
post #15

Earlier quoted context omitted.

Probably a spike in interest/activity/articles because of Google's announcement that it now is officially supported on Android.

Also because some of us absolutely needed a break from java.

Still looks like Java.

Re: Learn Kotlin in Y Minutes

#22
post #9

In terms of why we'd want to, there is this note here: https://kotlinlang.org/docs/reference/comparison-to-java.htm... Other factors to consider are tools support, how often interoprability with java libraries causes problems. Would be nice to hear from someone who has used it a bit about what the state of these is?

Come on. This is not about actual production stuff. It's new! It's cool! That's pretty much it.

No so. Many people use it in production. The language has been around for 7 years and a stable 1.0+ release for over a year. It's very much more mature than swift and rust and certainly sibling to go in that regard.

Re: Learn Kotlin in Y Minutes

#23
post #8
post #2

Kotlin's taken over HN.

Deservedly so. It is a great language, and it's backed by the ultra-power JVM. You can use a hipster language with great features and still use JodaTime and maven and all the enterprise stuff that just works.

What exactly make it a great language? What are the advantages compared to Java? I search for it but couldn't find any simple answer to that question. The fact that things are shorter to declare doesn't make it better. It makes it less readable.

Re: Learn Kotlin in Y Minutes

#25
I'm a bit disappointed that there's no metaprogramming support in Kotlin. Even Groovy had some AST-level transformators. Maybe we'll get some high-level API for writing APT-level tools in Kotlin itself ...

Re: Learn Kotlin in Y Minutes

#27
post #9

In terms of why we'd want to, there is this note here: https://kotlinlang.org/docs/reference/comparison-to-java.htm... Other factors to consider are tools support, how often interoprability with java libraries causes problems. Would be nice to hear from someone who has used it a bit about what the state of these is?

I am a pretty big fan, but for non-Android contexts I still like Scala better for a ton of reasons. I wrote a large Kotlin lib[0] the other day and documented a few annoyances[1] I had with it and the devs were very responsive (though non-devs seemed to pick apart maybe one or two of bullet points to dismiss the entire critique).

In the future I would use Kotlin for any Android need (obviously) and any time where I wanted to be lighter weight than Scala. As for native/JS use, I am waiting on the multiplatform story to materialize more before I have a strong opinion, but I would still go with Scala for how easy it is to develop multiplatform libs/progs w/ JVM/native/JS where I can easily have platform specific pieces. Kotlin is almost there[2], but not quite yet.

0 - https://github.com/cretz/asmble 1 - https://gist.github.com/cretz/2a49514b18914ef09b7c518db6db11... 2 - https://discuss.kotlinlang.org/t/abstraction-w-jvm-and-js-im...

Re: Learn Kotlin in Y Minutes

#28
> Declaring values is done using either "var" or "val". "val" declarations cannot be reassigned, whereas "vars" can.

I wonder why they decided on these very mistakable names. Why not const/constant/cons/whatever else just as long it's distinguishable from each other?

Re: Learn Kotlin in Y Minutes

#29

> Declaring values is done using either "var" or "val". "val" declarations cannot be reassigned, whereas "vars" can. I wonder why they decided on these very mistakable names. Why not const/constant/cons/whatever else just as long it's distinguishable from each other?

My guess is it came from Scala? In practice it's not very tough to get it right.

Re: Learn Kotlin in Y Minutes

#30
post #19

Earlier quoted context omitted.

What kind of sugar are you looking for? I'd like to have first-class comprehensions in any language I use, but having decent map/filter/reduce|fold implementations is good enough for the most part. (1..100).map({ it + 10 }) Doesn't seem so bad.

You can even get rid of the final parentheses. (1..100).map { it + 10 }

Somehow that seems even less readable to me.
Post reply on HN