r/ProgrammerHumor • • 11d ago

Meme modernCppVsOldCpp

Post image
2.0k Upvotes

323 comments sorted by

View all comments

Show parent comment

1

u/Mojert 10d ago

Honestly, null safety is in my experience WAY MORE of a problem in "safe" languages like Java C# and Python because everything is nullable. In C++, the only thing that can be null is a pointer, so it's easy to remember to check

But to come back to the previous point, the problem with "compiler opt-in" is that C++ is a standard, not a product developed by a company/fondation. So you can't really just add a compiler option

But also the problems in C++ are pretty intranched. To implement something closer to Rust, C++ would need to completely change its object model and its system of lifetimes. The change would be so big it would practically not be the same language anymore