3 ms·
No terenary if and the elvis operator, for one. Stuff like that trips me up frequently when jumping between Kotlin and Swift/other C-likes.
by cosmic_cheese 2y ago
No terenary if and the elvis operator, for one. Stuff like that trips me up frequently when jumping between Kotlin and Swift/other C-likes.
- koakuma-chan 2y agoIf expression: https://kotlinlang.org/docs/control-flow.html#if-expression https://kotlinlang.org/docs/control-flow.html#if-expression Elvis operator: https://kotlinlang.org/docs/null-safety.html#elvis-operator https://kotlinlang.org/docs/null-safety.html#elvis-operator
- bartekpacia 2y agoAh, I see. Tbh, I actually like the lack of ternary and elvis, they are nicely handled by if expression (as the other comment notes)