News for hackers. Stuff that matters.
Re:Std::string half of all allocations in the Chrome browser... by srj on Saturday December 06, 2014 @08:39AM (#8709191)
What's fragile, insecure, and terrible about them? I've written C/C++ (among other languages) for years at work and it's quite rare that I see a bug that could be attributed to the language.
Re:Std::string half of all allocations in the Chrome browser... by robotresearcher on Saturday December 06, 2014 @09:45AM (#8709281)
You rarely see uninitialized pointers or off-by-one array bounds errors? I wish that was true for my colleagues.
Re:Std::string half of all allocations in the Chrome browser... by srj on Thursday December 11, 2014 @12:22AM (#8733330)
Late reply - sorry that I missed your response.

I've found that RAII classes like std::unique_ptr have really helped. Errors like an uninitialized pointer are often caused by poor ownership semantics in the program design, and I don't think you escape that in reference counted languages. You'll still have a messy class design without clear ownership, and there are types of resources other than memory to manage (file handles, locks, sockets).

I'm not saying that your colleagues are bad engineers, I've had many troubles with ownership design over the years and still do at times. I just don't think C++ is unique in this regard even if it does force you to think about it more regularly since memory interaction is so common.