Live data from Hacker News

Retiring a favourite C++ joke

ignition-training.com

121–130 of 151 posts

Re: Retiring a favourite C++ joke

#121

Earlier quoted context omitted.

They should build ChatGPT into compilers so you can complain. 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!

ChatGCC "I'm sorry, as as an ML compiler I can't let you link glibc statically."

And on that day, I finally opened the Monolithic set of x86_64 programmer tomes, and finally figure out how to manually do linking.

You will be amazed how much of my skill with computers comes down to channeling Obsessive Defiance Disorder into digging into how to do what the compiler writers don't want to let me do, and doing it my way. With tests.

Re: Retiring a favourite C++ joke

#122
post #80
post #66

Earlier quoted context omitted.

I frequently work with companies that have old, large codebases. A key requirement of the training in that environment is that attendees are able to read existing production code. In some cases that's over twenty years old and millions of lines of code. new/delete is just part of that reality. We teach them without encouraging their use.

That's perfectly reasonable. I have fortunately worked on greenfield projects, so don't have to contend with legacy paradigms.

Ah, so you've been doing programming-lite.

You haven't programmed til you've come to the realization that billions of dollars worth of man hours are about to go down the toilet because of an assumption made 20 years ago, in a 4th order dependency, that you can't get rid of, and to rewrite is going to cost another couple million dollars, and spent a night with a bottle of whiskey wondering whether it's really all worth it.

Where my maintainers/InfoSec bros at?

Re: Retiring a favourite C++ joke

#123
post #110
post #105

Earlier quoted context omitted.

C++ does not have garbage collection in the standard library, just as shared_ptr was not part of the standard library in the past. You can currently have optional garbage collection in C++: https://github.com/pebal/sgcl

C++ can do pretty much anything, but that doesn't mean that it’s typical to do so. In practice, you will never see a garbage collector in C++.

You may be surprised. Herb Sutter wants to add optional GC to C++ 'syntax 2'.

Re: Retiring a favourite C++ joke

#124

Earlier quoted context omitted.

ChatGCC "I'm sorry, as as an ML compiler I can't let you link glibc statically."

And on that day, I finally opened the Monolithic set of x86_64 programmer tomes, and finally figure out how to manually do linking. You will be amazed how much of my skill with computers comes down to channeling Obsessive Defiance Disorder into digging into how to do what the compiler writers don't want to let me do, and doing it my way. With tests.

hacker disorder :)

Re: Retiring a favourite C++ joke

#125
post #80

Earlier quoted context omitted.

That's perfectly reasonable. I have fortunately worked on greenfield projects, so don't have to contend with legacy paradigms.

Ah, so you've been doing programming-lite. You haven't programmed til you've come to the realization that billions of dollars worth of man hours are about to go down the toilet because of an assumption made 20 years ago, in a 4th order dependency, that you can't get rid of, and to rewrite is going to cost another couple million dollars, and spent a night with a bottle of whiskey wondering whether it's really all wort…

> Ah, so you've been doing programming-lite.

I hope you can understand why that's offensive.

Re: Retiring a favourite C++ joke

#126
post #93
post #63

Earlier 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.

Hmm, I was at G until the recent decimation, and would have been surprised to see `new`, especially in new (heh) code, because it immediately raises the question of ownership, which means it costs time for every future reader. Taking chromium as a proxy (though the style isn't identical), there are currently 5 or 6 times as many `make_unique` as `new`. (Some false positives on the word ‘new’ in strings, because I don…

Now search for C arrays and strings, old style enums, str...() and mem...() functions, C style casts, preprocessor macros,..

Re: Retiring a favourite C++ joke

#127
post #126
post #93

Earlier quoted context omitted.

Hmm, I was at G until the recent decimation, and would have been surprised to see `new`, especially in new (heh) code, because it immediately raises the question of ownership, which means it costs time for every future reader. Taking chromium as a proxy (though the style isn't identical), there are currently 5 or 6 times as many `make_unique` as `new`. (Some false positives on the word ‘new’ in strings, because I don…

Now search for C arrays and strings, old style enums, str...() and mem...() functions, C style casts, preprocessor macros,..

That’s called whataboutism.

Re: Retiring a favourite C++ joke

#128
post #22

There's dozens of people who would get it... DOZENS!

According to the TIOBE index, C++ is the fourth most popular programming language, and has been around for over 35 years, so easily a couple thousand people. The question is how many of them are on HN (probably dozens).

It's number one in the TIOBIAS index, though.

Re: Retiring a favourite C++ joke

#129
post #109

Earlier quoted context omitted.

I think you’re making a joke, but reference counting is different than what a unique pointer does. (a destructor is not the same thing as a reference count, even if that reference count is limited as you suggest.)

No, I don't think it's a joke. It's just that when your counter is limited to values of 0 and 1 only, you can optimize it so heavily it almost looks like a different thing entirely: binary semaphores are usually called mutexes, but they're still semaphores.

Please show me the counter in std::unique_ptr :-)

Re: Retiring a favourite C++ joke

#130
post #123
post #110

Earlier quoted context omitted.

C++ can do pretty much anything, but that doesn't mean that it’s typical to do so. In practice, you will never see a garbage collector in C++.

You may be surprised. Herb Sutter wants to add optional GC to C++ 'syntax 2'.

Sitter’s idea in that is a different matter entirely.
Post reply on HN