4 ms·
Rusty has a significantly higher cognitive load for programmers than C. I find it quicker to write reliable code in C than in Rust because I can write the C cod
by zik 9y ago
Rusty has a significantly higher cognitive load for programmers than C. I find it quicker to write reliable code in C than in Rust because I can write the C code and a comprehensive set of tests quicker than I could write just the Rust code with no tests.
- steveklabnik 9y agoHow much time have you spent with Rust? This kind of thing will obviously vary with the individual.
- mannykannot 9y agoTesting does not perfectly substitute for verification, and vice-versa. In particular, comprehensive testing does not scale: at some point in the growth of your code, your testing will no longer be comprehensive, even if it started that way. On the other hand, no amount of static analysis will eliminate semantic errors (but neither will testing.)
- naasking 9y ago> I find it quicker to write reliable code in C than in Rust because I can write the C code and a comprehensive set of tests quicker than I could write just the Rust code with no tests. Tests can't establish the absence of bugs the way Rust can. You only think your C code is reliable, you don't actually know that it's reliable. Rust only appears harder because of the latent bugs in your C program that you're not aware of.
- dragonwriter 9y ago> Rusty has a significantly higher cognitive load for programmers than C. For simple cases, this may be true, for complex cases it but shifts the cognitive load up front. Which may be more frustrating, but also may prevent a large class of hard to identify, intermittent in manifestation, bugs from getting into production. Which also saves programmer frustration.
- flukus 9y agoI've been doing the same lately, I don't know how it would scale to a bigger project but I've been enjoying it so far. I've been running the tests under valgrind as well which has found 1 or 2 issues a lot faster than debugging would. The best part of that is that valgrind shows me actual errors in actual running code whereas the rust compiler shows potential errors.
- steveklabnik 9y agoValgrind works with Rust too, to be clear. Most similar tools, like AFL do too.