The article is missing the similarities between Swift Optionals and Kotlin Nullables.
Swift code:
var name: String?
name? ///returns a safe value
name! ///returns an unsafe value and throws an exception in case of a nil value
if name != nil {
///Now we can use name! forcing unwrap because we know it's not nil
}
if let unwrapedName = name {
/// Here we can use unwrapedName without forcing the unwrap
}
The null checks are almost the same in Kotlin: https://kotlinlang.org/docs/reference/null-safety.html