If this was found-in-the-wild C then I wouldn't be bothered with it, but this is completely contrived.
If this was found-in-the-wild C then I wouldn't be bothered with it, but this is completely contrived.
Of course, this is not only an argument in favor of in Rust, but any memory-safe language. Rust just happens to address some of the same problem domains that C and C++ have traditionally been dominant in.
John Carmack, apparently: https://twitter.com/ID_AA_Carmack/status/587077680652230656
Most of beginners out there, who then cannot figure out the reason for their crashes, especially when it's not explicitly returned as the value of the function ;)
General programming experience helps a lot. Someone coming to C from a higher level language likely knows to read compiler output and warnings, use debugger, read diagnostic output. With modern C toolset, that experience will help solve 99% of such errors.
OTOH, someone coming to Rust encounters set of problems no amount of programming experience help to solve. IMO for beginners, Rust’s learning curve is dangerously close to that of pure functional languages.