News for hackers. Stuff that matters.
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.
Re:C++ the Good Parts (2014) by todd8 on Friday October 02, 2020 @03:09AM (#24659846)
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.)
Re:C++ the Good Parts (2014) by pjmlp on Thursday October 01, 2020 @07:33AM (#24649707)
Re:C++ the Good Parts (2014) by darkmx0z on Thursday October 01, 2020 @09:11AM (#24650427)
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

Re:C++ the Good Parts (2014) by pjmlp on Friday October 02, 2020 @01:56AM (#24659369)
Which isn't exception safe, as any good C++ developer would know.
Re:C++ the Good Parts (2014) by msla on Thursday October 01, 2020 @03:40PM (#24655337)
"Google Does Bad Thing" is not quite equivalent to "C++ Is Bad Language"
Re:C++ the Good Parts (2014) by pjmlp on Friday October 02, 2020 @01:59AM (#24659379)
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.
Re:C++ the Good Parts (2014) by int_19h on Thursday October 01, 2020 @06:18PM (#24656752)
The Google C++ style guide alone is sufficient evidence to conclude that Google doesn't know how to do C++ properly.
Re:C++ the Good Parts (2014) by pjmlp on Friday October 02, 2020 @04:48AM (#24660517)
Yet they are one of the major contributors to ISO C++ and LLVM, what gives?
Re:C++ the Good Parts (2014) by int_19h on Friday October 02, 2020 @09:55PM (#24668862)
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.
Re:C++ the Good Parts (2014) by ncmncm on Saturday October 03, 2020 @02:21AM (#24670015)
In a word, not.