Re:C++ the Good Parts (2014)
by platinumrad on Thursday October 01, 2020 @06:38AM
(#24649396)
`new` and `delete` have been banned outside of deep library code in every industrial C++ codebase I've ever worked on.
[ Parent
| on HN ]
I don’t have first hand experience in the world of game programming, but I’ve heard that smart pointers aren’t used and old fashioned new and delete are standard practice. (Please correct me if I’m wrong, I’m curious if what I’ve heard about game development is really true.)
How industrial do you consider Android?
https://android.googlesource.com/platform/frameworks/base/+/...
did you check the header of that cpp? they are storing it in a shared_ptr: shared_ptr = referenced counted pointer = RAII
they should have used make_shared, but it is still safe
Which isn't exception safe, as any good C++ developer would know.
"Google Does Bad Thing" is not quite equivalent to "C++ Is Bad Language"
Indeed, it is even one of my favourite languages, but contradicts the OP's point of every industry C++ codebase has banned new and delete.
The Google C++ style guide alone is sufficient evidence to conclude that Google doesn't know how to do C++ properly.
Yet they are one of the major contributors to ISO C++ and LLVM, what gives?
It just means that they still derive value from C++. But I, for one, am very glad that they're not a dominant force in the ISO standard committee.