Hacker News new | ask | show | jobs
by pjmlp 961 days ago
While true, most compilers do enable bounds checking in debug releases, and there are compiler flags to keep those checks enabled in release builds.
1 comments

This is differently bad because it may mean tight loops are enormously slower under debug for no good reason, it's an adverse consequence of the C++ "wrong defaults" problem. Because they're defaults, we can't detect whether they're what was specifically needed or just nobody cared, so we guess nobody cared and act accordingly.
It isn't as if Rust is any different in this regard.
I'd argue exactly the contrary. In Rust you went out of your way to write the unsafe thing because that's specifically what you intended. As a result there's no need to try to guess whether this code doesn't care, if it didn't care it would be checked because that's the default.