4 ms·
> Sure, there can be logical errors, and it can be corrected. Yeah, but the vast majority of my bugs in C projects were logical errors :-/ Logical errors out
by lelanthran 4y ago
> Sure, there can be logical errors, and it can be corrected.
Yeah, but the vast majority of my bugs in C projects were logical errors :-/
Logical errors outnumber memory errors at roughly 100:1
- Gigachad 4y agoThe problem is memory issues are extremely toxic. They hold the ability to completely derail the program and do just about anything.
- woodruffw 4y agoThis is a measurement error: the idea behind Rust is to make the ratio between logic and memory errors infinite, by eliminating memory errors as a bug class (to a vanishing degree, anyways). Besides, logic errors in Rust don't cause memory errors as knock-on effects. Most of my logic errors in C and C++ codebases ultimately manifested as some form of unsound memory access.
- rich_sasha 4y agoIt's quite easy to accidentally segfault a C++ program. IME so far it's much harder to accidentally segfault a Rust one. Even unwrap et al are useful, because they show you explicitly where you assume something potentially unsafe is happening.
- worik 4y ago> Logical errors outnumber memory errors at roughly 100:1 Mēh! Possibly. But you can catch logic errors with logic tests. Catching memory errors is a different problem.