Here I will leave comments about Kotlin style patterns I notice, and my proposals on which ones seem most readable. Later we will discuss and compromise on something we can both live with :)
So far I noticed:
- I prefer to avoid Multiline ternary operators:
// Weird
return if (condition) {
"XXX"
} else {
"Yyy"
}
// Good
return if (condition) "XXX" else "Yyy"
- empty
when else should be on one line
when (cond) {
"X" -> functionality ()
else -> {}
}
Here I will leave comments about Kotlin style patterns I notice, and my proposals on which ones seem most readable. Later we will discuss and compromise on something we can both live with :)
So far I noticed:
whenelseshould be on one line