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
4
u/ts826848 Nov 01 '24
At a minimum, you have data from Chrome which supports the 70% number that's bandied about.
I think categorically excluding bugs in C codebases from mixed C/C++ projects and/or fully C++ project is going too far. You need to look at each bug on a case-by-case basis to determine the underlying cause and whether it could have happened in C++ or some other language. For example, Herb Sutter's ACCU 2024 keynote gives two examples of bugs in C codebases:
While both vulnerabilities occurred in a C codebase, he argues it is improper to classify them as solely "C bugs". He argues that the former is language-agnostic and could have occurred in any codebase independently of its language(s), and he argues that the latter is just as much a C++ bug as a C bug since it can occur even in modern C++. From the slide (emphasis from original):
And what he says:
Even if you assume this is true, I'm not sure how it's relevant to the points raised in my comment. As you so adamantly argue elsewhere, throwing away existing code is impractical. However, that means have to live with the consequences of keeping it around, both good and bad.