3 ms·
> Say, the "typical" rust laziness ... just unwrap() because well we know for sure it can't possibly be None, right ? Which is safe. > Do that in a form of cr
by keybored 3y ago
> Say, the "typical" rust laziness ... just unwrap() because well we know for sure it can't possibly be None, right ?
Which is safe.
> Do that in a form of crit code path, and while that may not open you to an exploit,
Oh, so you realize that it is safe.
> it'll still down your service and damn you to a crashloop.
So there isn’t an argument here.
Next.
- vlovich123 3y agoA DOS attack is still a security vulnerability, but as I describe above it's still a better failure mode than you get with C++.
- fch42 3y ago"memory-safe" != "safe". Make a fair assessment what it means to your app / service when you have a, however controlled/contained, reproducible unexpected (by the developer) exit. Or what it means to use a hardcoded default (unwrap_or). Or what it means to pass up an Err via "?". Or to map an Err to None. My argument is simple: The memory safety of rust is no reason to become arrogant as a programmer. It should, in fact, maybe make you more humble - what you learned about your own typical mistakes as you learned to write rust and tackle the borrow checker and decode clippy's extensive litany of sins in your source. And to consider that rust, as prime example, exists because people learned - from mistakes. From those design flaws in C/C++, namely. Assume you make mistakes as well is likely to turn you into a better person. Definitely into a better programmer. No matter which language you use. Hopefully rust (on that I fully agree)
- keybored 3y agoI will try to be more humble. Thank you.