Re:The two types of C programmers (a provocative thesis)
by gavinhoward on Sunday April 23, 2023 @08:34PM
(#35682293)
I don't know why you say that C is bad for exercising error conditions or fuzzing. In my experience, it's the best at those.
Re:The two types of C programmers (a provocative thesis)
by tialaramex on Monday April 24, 2023 @06:21AM
(#35685700)
It doesn't come with either capability, so you're adding third party tooling to get these working.
Re:The two types of C programmers (a provocative thesis)
by gavinhoward on Monday April 24, 2023 @09:01AM
(#35687140)
Well, sure, but that's true of any language.
Re:The two types of C programmers (a provocative thesis)
by tialaramex on Monday April 24, 2023 @11:23AM
(#35688756)
Nope, when I write tests in my Rust the out of box cargo test will check those tests pass.
If I wrote inline Markdown documentation for part of the Rust code with an example, cargo test will try to build my example, and check it works - not much good having a purported "example" which doesn't even work, is it? And yet many languages don't do this.
Re:The two types of C programmers (a provocative thesis)
by gavinhoward on Monday April 24, 2023 @02:41PM
(#35691442)
You said fuzzing and exercising error conditions. Rust's tooling does not do that. You need something to generate those tests.
Fuzzing is still not part of the default Rust tooling.
Re:The two types of C programmers (a provocative thesis)
by GoblinSlayer on Monday April 24, 2023 @04:13PM
(#35692549)
Mere existence of a test runner is infinitesimal compared to your proposed careful testing. Saying this as someone who wrote my own test runner, it's a few lines of code.
In that case this could have been caught with more careful unit tests, which would have exercised the erroneous condition, and potentially with fuzzing to excite corner cases. C is... not great for either of these.