4 ms·
To flip the question on its head, why bother with C++ when you can use Rust?
by TwentyPosts 3y ago
To flip the question on its head, why bother with C++ when you can use Rust?
- jhoechtl 3y ago30+ years of experience and time to ripen?
- bluGill 3y agoC++ with raii was an option 25 years ago. Today rust is the hot new in thing, but we waited a long time. There are rough edges in C too.
- vitiral 3y agoIf it's just about number of years then Rust 1.0 was in May 2015, so more than 8 years. Does a "thing" need to be around for a decade+ to no longer be "hot" or "new"?
- AlotOfReading 3y agoC++ with RAII doesn't make the language safe, it makes it less unsafe. Instead, we have 25 years of incremental language additions without meaningfully deprecating things. The officially sanctioned way to write memory-safe code in C++ is a non-existent set of compiler warnings that error when you use 80% of the language (profiles). To quote Stroustrup and P2410 [0]: "Experience shows that this [memory safety] cannot be done without static analysis and run-time support. Furthermore, for fundamental reasons this cannot done even with such support if arbitrary legal language constructs are accepted while conventional good performance must be maintained." [0] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2410r0.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p24...
- bluGill 3y agoWe are comparing to C here, which is clearly even more unsafe!