4 ms·
Neither Rust nor C++ eliminate logic bugs (and no language can do that). If you are writing code that must work, you should be either formally prove the system
by rujuladanh 8y ago
Neither Rust nor C++ eliminate logic bugs (and no language can do that).
If you are writing code that must work, you should be either formally prove the system (if feasible) or have a huge test suite covering everything.
- apta 8y ago> Neither Rust nor C++ eliminate logic bugs (and no language can do that). While true, it's a big benefit to eliminate classes of known bugs (e.g. memory safe languages eliminate undefined behaviors, and Rust eliminates data races). That allows the programmer to pay attention to other aspects of the code, since there's only so much energy one person can spend.
- rujuladanh 8y agoNo. If a system MUST work, then there have to be no bugs at all. Removing a class is useless. You have to remove all bugs. You are talking about systems that SHOULD work, but aren’t required to always work. Typically, safety-critical software is the latter, the rest of software is the former. But the latter are entirely different beasts, and is what we were discussing. By the way, Rust does not eliminate all race conditions; and memory safe languages may still have undefined behavior unrelated to memory (e.g. Rust)