https://kotlinlang.org logo
Title
i

iex

06/20/2018, 12:47 PM
@karelpeeters I'm talking about
fun foo() = print("hello")
vs.
fun foo() { print("hello") }
k

karelpeeters

06/20/2018, 1:29 PM
Only use the former when the body is a single, short expression? I'm not sure what kind of conventions you're looking for.
i

iex

06/20/2018, 1:49 PM
I explained it in the next message...
but here again, the differentiation is between when you want to return something / do something with the return value and perform only side effects
and at least in scala there used to be a convention that when you only want to perform side effects, the method was considered a "procedure" and put between
{}
- whether it was long or a one liner
so I wanted to know if there's something similar in Kotlin but it doesn't seem to be the case
even in Scala this convention seems to be outdated