2 ms·
How is it safer? Because of destructors?
by metadat 3y ago
How is it safer? Because of destructors?
- pubby 3y agoTake strings for example. In C you have to manually manage memory and there are a million pitfalls. Lots of programmers are lazy and use fixed-sized arrays and "unsafe" functions like strcpy which results in security vulnerabilities and large-input bugs. But even if you do it correctly you have all this mental overhead and lots of lines of code. In C++ you just drop in std::string and go.
- farseer 3y agoNo because of the current active community around C++. The large standard template library is safer to use than in-house implementation of the same data structures. The C++ Boost library also gives you a large arsenal of utility functions that is vetted by the community.