3 ms·
I agree with your comment about libraries. Destructors biggest advantage is in well used libraries. Any interesting code involves custom classes written by les
by papaf 5y ago
I agree with your comment about libraries. Destructors biggest advantage is in well used libraries.
Any interesting code involves custom classes written by less experienced developers that are only used once or twice in an application -- it is there that that the complexity of destructors hurt.
- ncmncm 5y agoThere certainly are design complexities in C++, around copy and move constructors and various operators. Some of those could have been avoided, in hindsight, and new languages can. None of those complexities spill over onto destructors. They were perfect in their original conception, and are unchanged 40 years on. They evoke no regrets. No bugs trace to anything unfortunate about destructors.