by blub · 7y ago · 0 comments
Anyway, I'm only clarifying that the parent poster was explicitly talking about safety outside of memory safety.
Using optionals, result types and match would give me a nice feeling too, but I won't claim that my code's safer because of that. Those are super low-level tools.
I've never had that experience in any other language. Usually unless you're careful and put effort into testing and making sure that you handle every possible exceptional case, you'll have several bugs and crashes. Of course these are possible in Rust, but in practice I'vr found they're mucb rarer. Most of these issues are caught by the compiler.
Whether you care about that or think it's valuable does not change that it is a way of encoding a model into your type system to make a class of errors impossible.
And the lack of evidence in this area suggests to me that the safety benefit is indeed negligible.
Apparently rarer than the occasional typo (the above sentence contains two).