Live data from Hacker News

Retiring a favourite C++ joke

ignition-training.com

91–100 of 151 posts

Re: Retiring a favourite C++ joke

#91
post #17

Even the compilers are in on some jokes: $ gcc -xc - : In function ‘main’: :1:45: error: ‘long long long’ is too long for GCC

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

Re: Retiring a favourite C++ joke

#93
post #63
post #51

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.

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't remember how to exclude them.)

https://source.chromium.org/search?q=\bnew\b%20lang:c%2B%2B%...

https://source.chromium.org/search?q=\bmake_unique\b%20lang:...

Re: Retiring a favourite C++ joke

#94
post #45
post #17

Even the compilers are in on some jokes: $ gcc -xc - : In function ‘main’: :1:45: error: ‘long long long’ is too long for GCC

I made this compiler joke and received whoping 930 upvotes for it: https://i.redd.it/dp6ixt4ri1hz.png

Why is it funny, please explain?

Re: Retiring a favourite C++ joke

#96
post #17

Even the compilers are in on some jokes: $ gcc -xc - : In function ‘main’: :1:45: error: ‘long long long’ is too long for GCC

A C++ programmer was arrested for indecent exposure. He was caught exposing his private class in public.

That's what friends are for, right?

Re: Retiring a favourite C++ joke

#98
post #97

Earlier quoted context omitted.

It is the error message you often get when creating a password.

Yes I get that, didn't quite understand why this switching of error message is relevant to the code...

I thought it was funny because I've seen similar complaints from linters, e.g. clang-tidy's readability-identifier-length plus readability-identifier-naming, or pylint's invalid-name. (clang-tidy at least is smart enough to exempt loop counters.)

Re: Retiring a favourite C++ joke

#99
post #97

Earlier quoted context omitted.

It is the error message you often get when creating a password.

Yes I get that, didn't quite understand why this switching of error message is relevant to the code...

Jokes often work with subverting expectations. In this case you're surprised by a message that doesn't belong and then you remember where it comes from and likely relate it with how frustrating those ever changing rules can be.

That's why the joke works.

Post reply on HN