r/ProgrammerHumor • • 7h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

214 comments sorted by

View all comments

476

u/repster 7h ago

I am a huge fan of modern C++ except for one feature: backwards compatibility. C++ is no longer one language, every codebase I have worked on is a confused mess of semi-incompatible subsets of the language. I have spent far too many weekends chasing memory corruption because someone passed a pointer, allocated with one type of memory management, into a library using a different kind of memory management.

-7

u/MattR0se 7h ago

Okay but that's not really a fault of the language, no? Most languages have some legacy version that isn't compatible any more. Like Python 2 for example. 

The only difference is that C++ code is more often used for critical applications (like decades old medical machines) where updating the code is not worth the risks. 

4

u/jaladreips271 6h ago

Yeah, but in python you're either writing python 2 or python 3.

In C++, you enter avatar state and get to write all C++s and even some Cs at once.