Impressed by how developers at #dayjob were able to elegantly leverage the Kotlin type system to create even more opportunities for NPEs:
fun info(tag: String?, msg: String?) {
logInfo(tag!!, msg!!)
}
Impressed by how developers at #dayjob were able to elegantly leverage the Kotlin type system to create even more opportunities for NPEs:
fun info(tag: String?, msg: String?) {
logInfo(tag!!, msg!!)
}
π¨βπ» Elevate your Kotlin skills with Romain Guy from Google! Join our live discussion on performance and optimizations: https://cwti.link/twitch #KotlinTips #EfficientCoding
#KotlinTips
The βwhenβ expression is exhaustive if used in combination with sealed classes or enums. The compiler will complain if you forget to handle any of the cases, thus alerting you to possible mistakes.
RT @kotlin@twitter.com
Use the partition function to split a collection into two lists based on a predicate. The function returns a pair of lists:
the first contains all elements for which the predicate evaluates to true;
the second contains all the other elements. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/partition.html
#KotlinTips
π¦π: https://twitter.com/kotlin/status/1344284620146286593