Optionals encode the presence or absence of a value in its type.
An optional says:
- There is a value, and it equals x, or
- There isn’t a value at all
In languages without the option type, every type can be nullable, with null hanging around every corner waiting to jump out at you. With optionals, we can not only identify to the reader where null might pop up, but we can use option unwrapping to properly handle such cases.