Join Slack
Is there any advantage using Option over nullable?
# arrow
k
Kev
11/01/2024, 3:50 AM
Is there any advantage using Option over nullable?
a
Alejandro Serrano.Mena
11/01/2024, 8:13 AM
in general you should prefer nullable types because of their better integration with the language
Option
wins, though, when "something is `null`" is a potential result and you want to distinguish it from error a longer version of this is available in the API docs
https://arrow-kt.io/learn/typed-errors/nullable-and-option/
Alejandro Serrano.Mena
11/01/2024, 8:13 AM
(any feedback on that page is welcome 🙂 , since this is a topic which is raised from time to time)
t
Ties
11/01/2024, 8:34 AM
Its better to raise this topic than exceptions 🙂
homer disappear
1
😂 4
🥁 7
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by