3 ms·
Except kotlin doesn't have anything close to swift regarding enums + switch (like : enum with associated values of various arity, and a switch that makes sure y
by bsaul 8y ago
Except kotlin doesn't have anything close to swift regarding enums + switch (like : enum with associated values of various arity, and a switch that makes sure you're handling all the cases), nor regarding null safety.
And, it still has java underneath, which means everytime you're using a java lib, you have absolutely no idea what the null safety is going to be underneath (which is also the case with swift and objc libs, but which diminishes the attractivness of using the java libs ecosystem)
EDIT: also, value-based programming is highly encouraged by the full support for structs, either mutable or immutable. That's also a huge plus for safety against race conditions.
- dualscyther 8y agoKotlin has sealed classes (enums), when expressions (switch checking) and absolutely does have null safety. It also reinforces null safety when using Java libraries if they have nullability annotations.