4 ms·
Rust is a lot better in this aspect, but this is a symptom of not having proper code review and standards. Do not forget that in some scenarios using unwrap is
by mariopt 3y ago
Rust is a lot better in this aspect, but this is a symptom of not having proper code review and standards.
Do not forget that in some scenarios using unwrap is totally fine if a panic is acceptable.
The same could be said for javascript: How many time have we not wrapped JSON.parse inside a try catch? More than we would like to admit.
Really appreciate Rust “forces” you to handles all execution paths.
- foldr 3y agoMy link is to the rust repo on github. Does the Rust project not have proper standards for Rust code?
- Philpax 3y ago> Do not forget that in some scenarios using unwrap is totally fine if a panic is acceptable. Looking through the first few pages, most of these panics are easy to audit, and are infallible or in contexts where it doesn't matter (internal tooling, etc). That's a pretty stark difference to every single reference being a potential landmine.
- foldr 3y agoYes, you are probably less likely to get a panic caused by a nil reference in Rust than in Go. My point is that the equivalent software written in Rust (or most other languages with option types) would probably have had at least some of these very same bugs.