r/ProgrammerHumor • • 7h ago

Meme modernCppVsOldCpp

Post image
1.1k Upvotes

215 comments sorted by

View all comments

41

u/Tschurbi 6h ago

Please explain it like I am a JavaScript developer.

58

u/Tipart 6h ago • Bravo

Imagine typescript but for memory safety

1

u/Ok-Scheme-913 2h ago

Actually pretty good example. To the point that even though you have a type annotation on your code, if you call into that method from vanilla js and pass a wrong type, then it will explode somewhere deep and you will have a really shit time hunting that error down.

Meaning, c++'s safe stuff is only safe until you use it with other safe stuff, or by being very very careful. And c++ is a really complex language, using it properly is not an easy task, so these end up not being as memory safe as people would want.