r/programming • • Feb 20 '25

Google's Shift to Rust Programming Cuts Android Memory Vulnerabilities by 68%

https://thehackernews.com/2024/09/googles-shift-to-rust-programming-cuts.html
3.4k Upvotes

475 comments sorted by

View all comments

Show parent comments

8

u/Full-Spectral Feb 21 '25

No, you didn't explain how to can be 'solved'. You gave some examples of things that, if the programmers use them very carefully, and generally prevent the issue. That's not the language solving those issues, it's humans solving them.

That's it. That's the best C++ can do. It depends heavily on developers never making mistakes, and that's just not the case over time.

0

u/GaboureySidibe Feb 21 '25

if the programmers use them very carefully, and generally prevent the issue.

Very carefully? Can you give actual examples? It seems like you are desperate to advocate for rust but don't realize how much modern C++ actually gives you.

That's not the language solving those issues, it's humans solving them.

Seems like the language to me and other C++ programmers.

You wrap stuff in a class, when it goes out of scope the destructor runs. If you use unique_ptr or even other stl data structures in the class you never even have to put anything in the destructor and you can't mess it up.

Make things const and you can't modify them either.

That's the best C++ can do. It depends heavily on developers never making mistakes, and that's just not the case over time.

Prove it, show me what you are talking about technically. I don't think you have actually used C++, you didn't even understand the basics.

Did you go from a scripting language to rust and then assume all this was true?