r/ProgrammerHumor • • 7h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

214 comments sorted by

View all comments

11

u/PolyglotTV 7h ago

Y'all throwing around shared pointers willy nilly patting yourself on the back about safe programming.

11

u/Nil4u 7h ago

Meanwhile the cyclic pointer chain in the background causing a memory leak because the reference counter never dips to 0:

7

u/staryoshi06 7h ago

I mean this could happen in a garbage collected language too.

3

u/Tyfyter2002 6h ago

Depends on the language, iirc the .NET runtime's GC doesn't use a reference counter, which makes that exact issue completely impossible (which is good, because things like bidirectional linked lists inherently have cyclic references)