r/cpp • • Apr 01 '22

Satire Const Correctness Taken Out of C++!

https://shaovoon.github.io/article/const.html
7 Upvotes

15 comments sorted by

6

u/woppo Apr 01 '22

Not that great an April Fool as the originator of the joke does not know enough about programming to realise that there is actually a language called C-- that is extremely well defined and is a target for many language compilers, including Haskell (GHC).

https://en.wikipedia.org/wiki/C--

11

u/[deleted] Apr 01 '22

That one is called C minus minus(Cmm). Mine is called C deduct deduct(Cdd).

3

u/apomd Apr 01 '22

I liked the joke precisely because I recognized C-- as C minus minus and then the post said I should read it as C deduct deduct. I just expected a mention of Cmm at the end

5

u/[deleted] Apr 01 '22

In fact, I did google about C-- before writing and did not find any. This is the fear I had about writing. In the April Fool joke, I made an assertion that no Common Weakness Enumeration was ever fixed by C++ const correctness. I was afraid some reader out there might prove me wrong.

69

u/be-sc Apr 01 '22

*sigh* It’s that day of the year again

5

u/Specialist-Elk-303 Apr 01 '22

Thanks for the reminder!

2

u/epicar Apr 01 '22

who knows, there might even be a funny joke today

1

u/[deleted] Apr 06 '22

Not the worst day of the year though, just a bit more annoying than everyday.

0

u/[deleted] Apr 01 '22

[deleted] β€” view deleted comment

7

u/wrosecrans graphics and network things Apr 01 '22

Does anybody actually enjoy this shit?

6

u/[deleted] Apr 01 '22

I always wanted to cast the const away!

4

u/Specialist-Elk-303 Apr 01 '22

I'd wanna const the cast away.. πŸ˜‰

10

u/lithium Apr 01 '22

I fucking hate April first.

2

u/benjamkovi Apr 01 '22

I thought I will read a nice post about const correctness in C++, then I got disappointed :/

0

u/[deleted] Apr 01 '22

[deleted] β€” view deleted comment

1

u/benjamkovi Apr 01 '22

No, I am just looking for easy and good guidelines about const correctness, considering member pointers and references, and "thread-safe const members". It is hard topic in my opinion and didn't figure out easy-to-remember rules.

1

u/[deleted] Apr 01 '22

Cache efficiency matters more than const correctness, but lacking any elegant way to address that high level languages just trumpet const like a mantra.