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

This is not my experience. Most developers are just not very good at what they do, and the go-to smart pointers for not-very-good C++ developers is std:shared_ptr<T>.


This has been my experience as well - especially when C++11 came out. I have seen codebases where it has been "use std::shared_ptr for everything, becuase it is safer if/when we use threads". I know that doesn't make sense, but it just was the attitude back then.

Tbh, Back then, I didn't see a problem with it. Once i started chasing down weird bugs where objects aren't freed properly because no one knew which objects own what, I have been very cautious.


We had a few developers like that here when C++11 was introduced, but a few people gave them the smack down and now we rarely see shared pointers.


Hmm, that might be. Most of the C++ I've seen has been in LLVM, Google projects, projects where I'm the only developer or projects where I laid the groundwork which other people build upon, so I'm probably not mainly looking at the kind of code bases you're talking about.


OK but those people aren't going to magically write safe performant C either.




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

Search: