4 ms·
> everyone reaches for shared_ptr way too quickly I dont't think it's as bad as it sounds, and I have an explanation: C++ has evolved to the point when the eas
by Koshkin 9y ago
> everyone reaches for shared_ptr way too quickly
I dont't think it's as bad as it sounds, and I have an explanation: C++ has evolved to the point when the ease of coding in it is comparable with that of Java; so, more people use C++ as if it was Java, and shared_ptr is the closest thing to garbage collection that C++ standard library provides.
- vvanders 9y agoOh no, it really is that bad. You haven't lived until you've root-caused a ref cycle 3 libraries deep in a 200kloc+ codebase. This problem also isn't exclusive to C++, I've had nasty libraries in Java add things to the root set silently to the same effect.