3 ms·
I would disagree. Rust's borrow checker and other static analysis are more akin to the safety guards on a table saw. For 95% of situations they're just protect
by Measter 4y ago
I would disagree. Rust's borrow checker and other static analysis are more akin to the safety guards on a table saw. For 95% of situations they're just protect you by catching your mistakes, but there are times when the guard makes it hard or impossible to do what you need to.
In those situations, if you really need to do the work, you take the guards off for that work (unsafe would be the Rust equivalent), then put them back on afterwards.
- steveklabnik 4y agoYou’re totally right. I often cite https://www.sawstop.com/ https://www.sawstop.com/ as an even deeper analogy, in my opinion!
- JohnFen 4y agoHuh. I think perhaps I was thinking a bit wrong about "unsafe". My take on it was that it's a kind of cheating and its use would be disallowed in commercial production environments. At least, it seems to get badmouthed a lot.
- convolvatron 4y agomaybe unsafe rust is pretty ok to work in. as you say, I've never been in a shop where that was allowed
- steveklabnik 4y ago> its use would be disallowed in commercial production environments. Working in embedded, completely banning unsafe would be impossible. Minimizing it is a good thing, generally. But it's there to be used.