Did you know that IntelliJ can try and convert code from Java to Kotlin? The output is mechanical, works good for most cases or to get an idea of how it can be written in Kotlin, but it’s not idiomatic. Some times you have to clean it afterwards or just rewrite it by hand.
m
Mark
06/01/2020, 7:56 AM
I used the converter in AndroidStudio and the first snippet above, is what it spat out.
m
Matteo Mirk
06/01/2020, 7:57 AM
haha nice! Of course it’s not so smart to find a stdlib function to replace your old code… but sometimes it will