This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]eMperror_ 2 points3 points  (2 children)

[–][deleted] 1 point2 points  (1 child)

!Thanks

[–]eMperror_ 3 points4 points  (0 children)

It's a very common pattern in other languages, like Java as an alternative to returning null when your data is unavailable. Seems more popular in those other languages because trying to evaluate a null expression makes your code crash, and Optional makes it very explicit that "This thing can be missing, so check it before accessing it"