Description
I realised this when replying to @eholk on my blog: http://winningraceconditions.blogspot.com/2012/09/rust-0-index-and-conclusion.html?showComment=1348721405975#c9047445512681989061
Basically, I worry that novices who are familiar with null pointer checks but not familiar with the functional "option" idiom will start learning rust, then pop into the channel or go to their friends asking "How do I get the T
out of an Option<T>
??", and start using get()
or unwrap()
indiscriminately, when really they should be learning about match
and how to properly handle the None
case.
I think a big step here would be to write something like "WARNING: If you are not SURE that the optional value is not None, use a match statement instead and handle the None case explicitly!" in the documentation for these functions.