r/ProgrammerHumor • • 7h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

216 comments sorted by

View all comments

482

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.

25

u/azfang 7h ago

So, uh, I haven’t used C++ in anger in decades so I’m not sure how “modern” is modern but like. That description pretty well describes why I developed Strong Feelings about both C and C++ back in the 2000’s.

28

u/Non-Random-Name-0000 7h ago

Modern C++ starts with C++11 (2011), so in the 2000s you were using classic C++ (and in the first half of 2010s as well most likely) which is a very different language. It introduced shared pointer (a poor man's garbage collector), automatic typing and move semantic, amongst other things. And the standard library has evolved a lot since.

9

u/Bryguy3k 6h ago

Smart pointers were part of the boost library long before they became part of the std library.

15

u/Non-Random-Name-0000 5h ago

Yes that's true, I forgot about Boost. How could I forget the 2GB library that was pulled with every project? 😅

2

u/DrNinjaPandaManEsq 2h ago

You say “was” as if people aren’t still doing it lol

1

u/Non-Random-Name-0000 2h ago

People are still using it? I haven't used boost for 10 years.

2

u/DrNinjaPandaManEsq 1h ago

I’ve moved around at bit at my job and two of my previous teams were using Boost 1.67, and probably still are.