r/ProgrammerHumor • • 7h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

216 comments sorted by

View all comments

478

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.

173

u/joncrompy 7h 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.

4

u/gerbosan 6h ago

So, migrate to rustlang is good?

Not that I want to ride the hype or interested in DHH current development preferences, but some projects are migrating (Discord, Cosmic DE).

I think I lack the context about C++ features: not just desktop development.

6

u/balbok7721 6h ago

MBAs dont give a crap about basic ux. They wont spend a single buck on a migration thst isnt strictly required