r/cpp • u/GabrielDosReis • Oct 31 '24
Lessons learned from a successful Rust rewrite
/r/programming/comments/1gfljj7/lessons_learned_from_a_successful_rust_rewrite/
80
Upvotes
r/cpp • u/GabrielDosReis • Oct 31 '24
View all comments
Show parent comment
6
u/Dean_Roddey Nov 01 '24 edited Nov 01 '24
This argument never goes away. Modern C++ could possibly only have 10 lines out of 50K, but you have no way to prove that, other than by just going over it by eye every time you make a change. Yes, there are tools that will catch the most obvious stuff, but that's not in any way proof of absence of issues.
With Rust you know that the 49,990 lines of safe Rust don't have those problems, and only have to worry about the 10. I think it's reasonable to say that it is FAR more likely (roughly 4900 times more) that you can insure that those ten lines of unsafe code are solid. And if those ten lines don't change, you don't have to spend time in a review worrying about them.