Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How is it safer? Because of destructors?


Take 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.


No 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: