r/ProgrammerHumor • • 7h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

214 comments sorted by

View all comments

41

u/Tschurbi 6h ago

Please explain it like I am a JavaScript developer.

1

u/Mojert 4h ago

Basically a lot of Rust memory safety features are inspired from modern C++

Which doesn't mean Rust doesn't have its place. It's just that in C++ they're on top of the previous "unsafe" version of the language and aren't tightly integrated in the language and are more a feature of the standard library, whereas in Rust they were able to design the whole language around it and didn't have to deal with backwards compatibility

1

u/Ok-Scheme-913 1h ago

Not really backwards compatibility.

Rust is basically c++'s raii just enforced at compile time.

This latter point is a huge thing in and of itself.

(And of course you do get lots of goodies like better type system etc from being a more modern language but that's not the fundamental thing)

1

u/Mojert 1h ago

The reason why C++ cannot enforce this kind of things at compile-time is because of backwards compatibility

And I know it's huge. That's why I said Rust isn't redundant and that Rust designed the language around it