Earlier quoted context omitted.
No, it’s not just theory. Like anything in C++, codebases and their styles widely vary. But my comment holds true for the vast majority of developers I have worked with over the last decade. With the exception of the special “placement new“ operator, it is nearly obsolete to use new and delete.
I suggest browsing around code from Microsoft, Google, Apple,... Plus there are those tons of enteprise code, hardly the "vast majority". The only place I see modern C++ as advocated, it at C++ conference talks, and my own hobby coding.
Retiring a favourite C++ joke
81–90 of 151 posts
Re: Retiring a favourite C++ joke
#82Even the compilers are in on some jokes: $ gcc -xc - : In function ‘main’: :1:45: error: ‘long long long’ is too long for GCC
You: $ gcc -xc - Compiler: :1:45: error: ‘long long long’ is too long for GCC
You: Do it again, damn it, but this time show no errors!
Re: Retiring a favourite C++ joke
#83Re: Retiring a favourite C++ joke
#84Earlier quoted context omitted.
> the modern practice of never using new or delete at all in C++ code What? How do you (de)allocate memory without new and delete? If the answer is "smart pointers" then why bother use C++ in the first place, just use Go or something.
Why would you respond to a comment about a topic you don't understand and spread false information? You clearly cannot tell the difference between garbage collected language and smart pointers.
Re: Retiring a favourite C++ joke
#85Earlier quoted context omitted.
I suggest browsing around code from Microsoft, Google, Apple,... Plus there are those tons of enteprise code, hardly the "vast majority". The only place I see modern C++ as advocated, it at C++ conference talks, and my own hobby coding.
If you are going to work with a legacy codebase, then sure. My comment was more about fresh codebases, which are fortunately the only ones I've worked on.
Re: Retiring a favourite C++ joke
#86Even the compilers are in on some jokes: $ gcc -xc - : In function ‘main’: :1:45: error: ‘long long long’ is too long for GCC
The old MPW compiler had some gems: https://www.cs.cmu.edu/~jasonh/personal/humor/compile.html > This label is the target of a goto from outside of the block containing this label AND this block has an automatic variable with an initializer AND your window wasn't wide enough to read this whole error message
Re: Retiring a favourite C++ joke
#87Re: Retiring a favourite C++ joke
#88Even the compilers are in on some jokes: $ gcc -xc - : In function ‘main’: :1:45: error: ‘long long long’ is too long for GCC
Re: Retiring a favourite C++ joke
#89Earlier quoted context omitted.
Why would you respond to a comment about a topic you don't understand and spread false information? You clearly cannot tell the difference between garbage collected language and smart pointers.
Ah, so reference counting is not considered a form of garbage collection any more? Ingenious but somewhat of dishonest.
Re: Retiring a favourite C++ joke
#90It's an OK C++ joke, but not great. I could certainly give the author a few pointers...