Re:The Curious Case of the Longevity of C
by zik on Tuesday October 03, 2017 @06:32AM
(#15391408)
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.
[ Parent
| on HN ]
Re:The Curious Case of the Longevity of C
by naasking on Tuesday October 03, 2017 @10:03AM
(#15392465)
> 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.
Re:The Curious Case of the Longevity of C
by mannykannot on Tuesday October 03, 2017 @07:35AM
(#15391658)
Testing 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.)
Re:The Curious Case of the Longevity of C
by dragonwriter on Tuesday October 03, 2017 @10:41AM
(#15392707)
> 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.
Re:The Curious Case of the Longevity of C
by steveklabnik on Tuesday October 03, 2017 @06:36AM
(#15391424)
How much time have you spent with Rust? This kind of thing will obviously vary with the individual.
Re:The Curious Case of the Longevity of C
by flukus on Wednesday October 04, 2017 @03:37AM
(#15398871)
I'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.
Re:The Curious Case of the Longevity of C
by steveklabnik on Wednesday October 04, 2017 @04:17AM
(#15398998)
Valgrind works with Rust too, to be clear. Most similar tools, like AFL do too.