logoalt Hacker News

direwolf20yesterday at 11:47 PM3 repliesview on HN

Using containers and std::string for everything eliminates the majority of safety bugs.


Replies

AlotOfReadingtoday at 1:55 AM

If only the standard differentiated between programs that are "mostly" free of UB and programs that aren't.

porneltoday at 12:49 AM

The safety bar is way way higher.

The C++ WG keeps looking down at C and the old C++ sins, sees their unsafety, and still thinks that's the problem to fix.

Rust looks the same way at modern C++. The std collections and smart pointers already existed before the Rust project has been started. Modern C++ is the safety failure that motivated creation of Rust.

cataphracttoday at 2:05 AM

Not really. We keep getting pointer-like types like std::string_view and std::span that can outlive their referents.