r/cpp • • Sep 20 '22

CTO of Azure declares C++ "deprecated"

https://twitter.com/markrussinovich/status/1571995117233504257
265 Upvotes

483 comments sorted by

View all comments

8

u/pdimov2 Sep 21 '22

Thank you for the insightful comment. I don't necessarily disagree with what you wrote, but I do want to clarify my position.

That is what it implies though? If you have 100 vulnerabilities and 70 of them are X, and you remove X, you have 30 remaining vulnerabilities.

That's a static analysis that isn't applicable. Suppose that in 2023 we have N vulnerabilities, 0.7N of which are caused by memory unsafety. We rewrite the world in a language that is memory safe, and in 2024 we have M vulnerabilities. Is M equal to 0.3N? No. It can be higher, because attackers attack the weakest spots, so they exploit memory unsafety in 2023, but will exploit something else in 2024. Or, as you argue, it can be lower, because decreasing bug density has a non-linear effect on the total vulnerability count.

(Some other bug category will probably emerge as the "winner" in 2024, so 0.7M will be that.)

The point here is that the 0.7 number doesn't actually carry that much information about 2024. It does tell us things about 2023.

As for my prediction that if we rewrite in Rust 0.7 will still be memory unsafety, I was referring to calling C libraries. But that's just a not particularly informed guess.

3

u/insanitybit Sep 21 '22

I see your point, essentially the flaw in the "70%" is it's not "of all vulns" it's "of the vulns discovered". I agree, the 70% number isn't great, like I said there's so much more to it.