3 ms·
It is also worth noting that theoreticals don't help such discussions either. Yes, C programmers can do much more checks. The reality on the ground is -- they
by pdimitar 1y ago
It is also worth noting that theoreticals don't help such discussions either.
Yes, C programmers can do much more checks. The reality on the ground is -- they do not.
Forcing checks by the compiler seems to be the only historically proven method of making programmers pay more attention.
If you can go out there and make _all_ C code utilize best-in-class static checkers, by all means, go and do so. The world would be a much better place.
- delamon 1y agoCorrect. Any language with builtin bounds checking would work.
- pdimitar 1y agoIf your only criteria is "remove the buffer under- and over-flows", yes. IMO Rust helps with a few more things. Its strong static typing allows for certain gymnastics to make invalid states unrepresentable. Though in fairness, that is sometimes taken too far and makes the code hard to maintain. Tradeoffs, as always.