3 ms·
> if you still need a block body but dislike the mandatory return You know, in Groovy, the return is always optional... Kotlin copied the lambda syntax from Gr
by brabel 3y ago
> if you still need a block body but dislike the mandatory return
You know, in Groovy, the return is always optional... Kotlin copied the lambda syntax from Groovy but didn't copy that for some reason (notice how this makes the language inconsistent, as "some" blocks require a mandatory return, others don't... Rust for example, like Groovy, does not require return in either situation).
But I remember some of my colleagues were shocked by Groovy not requiring a return :D OMG that makes the code so hard to read!!!!! People just tend to not like anything that goes against what they do in their main language even when that doesn't really make any sense.