r/ProgrammerHumor • • 24d ago

Meme modernCppVsOldCpp

Post image
2.0k Upvotes

323 comments sorted by

View all comments

870

u/repster 24d 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.

361

u/joncrompy 24d ago

This is, ironically, the exact reason C++ is the standard in some industries. Students can learn the OOP C++ then work in the same codebase as someone programming "touching the metal" low level C.

Most languages make trade-offs between performance, structure, memory safety, and ease of writing. Every language might have their use, but very few cover all use cases.

C++ lets each programmers choose those trade-offs individually, but that also allows them to choose none of the above.

238

u/rndrn 24d ago edited 24d ago

C++ is really the thousand-edged sword. It is both its strength and its weakness.

→ More replies (8)

41

u/xtravar 24d ago

Sounds like if C++ were a spoken language, it'd be English.

→ More replies (1)
→ More replies (13)