https://kotlinlang.org logo
Title
k

Kevin Huang

11/07/2018, 10:44 AM
Which features attract you to use Kotlin?
I like coroutines.
s

seizma

11/07/2018, 11:43 AM
closures like in functional languages, native compiler, tail call optimisation
k

Konstantin Petrukhnov

11/07/2018, 11:59 AM
Shared code between jvm and ios (combination of performance and ease of use).
y

yen

11/07/2018, 12:12 PM
The ability to declare functions outside of classes. I mean come on Java
s

Spike Baylor

11/07/2018, 12:44 PM
Honestly my favorite "feature" is that i seem to find myself thinking "oh man i have to do X small yet annoying thing" just to find out "oh no i don't, theres an ext function for that!" Also TornadoFX is fun.
c

Chris Cunningham

11/07/2018, 12:45 PM
that its not java and can be used in the same places
loose functions, closures
extension methods
s

Spike Baylor

11/07/2018, 12:49 PM
the combination of extension functions, ext functs with receiver, lambdas, and what i thought was a weird feature of putting the last function parameter on the outside of the
()
inside of
{}
instead ...that come together to make the various DSLs is quite nice.
c

Chris Cunningham

11/07/2018, 12:55 PM
yeah i still find that one odd
s

Spike Baylor

11/07/2018, 1:14 PM
It's one of those things that sounds really arbitrary and useless until you see it in action. So if you've used .apply {} or .let {} or any of the DSLs like tornadofx or ktor it starts to click.
n

Nikky

11/07/2018, 1:19 PM
combine that with extension functions with receiver object inside your DSL objects/class and you get the power of the DSL, you can quite possibly model any arbitrarir nested configuration in a typesafe and readable way
then add generics to the receivers and you get somewhere
i should probably make some sample that showcases what i mean
c

Chris Cunningham

11/07/2018, 1:34 PM
yeah only starting to do stuff with a DSL now
but before then, it seems like extra syntax for no reason
i kinda feel the same about the implicit
it
in lambda expressions as well
k

Kevin Huang

11/07/2018, 2:04 PM
But kotlin need remember more things then java.
n

Nikky

11/07/2018, 2:11 PM
do you mean when writing kotlin or the kotlin compiler ?
s

Sylvain Moindron

11/07/2018, 2:36 PM
data class, null safety, less verbose code