What’s Wrong with Null?
Why would Tony Hoare, the inventor of null references, call it his “billion-dollar mistake”? How much harm could a valueless value possibly cause? Well, a lot. When null is available to you, you might unintentionally treat a null value as a non-null value. This leads to all sorts of errors (billion-dollar ones, even). That is why Rust does not have null references. Instead, you must explicitly declare whether the absence of a value is possible, as well as explicitly handle the case when it is: