Hacker News new | ask | show | jobs
by gefhfffh 1578 days ago
It's not like C++ is always the only alternative, see e.g. Rust which is way simpler
1 comments

I agree that Rust is simpler than C++ (in some ways), but I’d say it is far more complex than C.
That depends on how you define complexity. It is far easier to write a working program without memory leaks, various types of vulnerabilities, and undefined behavior in Rust than it is in C.
It depends on what level of security you need. If you're writing a 3D game engine, a minor memory leak probably isn't worth the extra time required to write it in Rust. Even if you're writing a kernel, fuzzing and formal verification can get you 99.999 of the way to the guarantees of Rust.
I feel like writing Rust is a whole lot faster and less error-prone than writing something in C. But even assuming that it's slower, it's definitely much faster than writing C and doing formal verification. Naturally formal verification can help with other properties besides memory safety, and as far as I am aware Rust is still lacking a formal semantics so when you go all-in on formal methods C can reach a provable level of quality that Rust currently cannot. But very few people develop software that way.