The slide "start simple" why not ```fun whichColor...
# education
a
The slide "start simple" why not
Copy code
fun whichColor(str: String) = if(str == "blue") Color.Blue else Color.Black
s
I wanted to introduce some of the syntax sugar gradually, to allow people to acclimate to some of the language parts where Kotlin is different from languages they might already know – a few slides later, I also bring up expression bodies. Your implementation is of course just as valid! 🙂
a
Yeah, Is see it now.
It is actually a good question if the expression bodies are good, but I just find them irresistable.