Gabor Varadi
Jul 21, 2017 · 1 min read

since quartile and percentQuartile are declared as vals, you’re forced to add the else case which will catch erroneous input values.

That’s not all that special though. I mean you already get that with

final int quartile;
final float percentQuartile;

val isn’t all that revolutionary. That’s something Java already does out of the box, with the final keyword.

I’m not a big fan of early returns in functions,

It’s a common practice though to avoid deep nesting of control statements.

Easier to read than

for(...) {
if(x != ...) {
for(...) {
if(y != ...) {
}
}
}
}

Now I wonder what it would be like if we inherited guard let ___ else { return; }from Swift.

Apparently you can simulate it with

val x = blah ?: return;

— — — — — — — — — — — —

when is nice though, but the primary selling point is ?. and data classes.

I kinda dread the future, though — reviewing extension methods, written by others...

I don’t see the true power of custom delegates, yet.

What was the weirdest to me as a “grumpy Java dev” is that there is no isTrue ? true : false ternary conditional operator, just if isTrue { } else { }.

)
    Gabor Varadi

    Written by

    Android dev, `Zhuinden`, or ‘EpicPandaForce’ @ SO. Extension function fan #Kotlin, dislikes multiple Activities/Fragment backstack.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade