Hacker News new | ask | show | jobs
by foundajob 1297 days ago
> an ecosystem that prioritizes safety etc.

Idiomatic Rust code is just as cavalier regarding NPEs as Java or Python code. Because the language starts to look really gross when you make your code panic-safe. So you have an `expect` here, an `unwrap` there, and now you're going to have the exact same runtime issues as the more expressive managed languages. No Rust programmer thinks their `expect` will panic, just like no Java programmer expects something will be null. Rust does not force you to "exhaustively match".

1 comments

expect is a lot safer than ignoring a return code.
Java and Python don't use return codes, they use exceptions. If you ignore an exception your program crashes, same as a panic in Rust.