this post was submitted on 16 Mar 2025
804 points (100.0% liked)

Programmer Humor

21852 readers
1088 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
804
C++ (ani.social)
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/[email protected]
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 57 points 1 week ago (3 children)

So? Do you really expect the compiler to UNDERSTAND the code?

Here is a grammatically correct phrase for you to think:

Compilers don't paint tangential apostrophes unless the storm value is deeper than radish. Fraggles love radish.

[–] [email protected] 46 points 1 week ago (3 children)

This is something that Rust is specifically designed to prevent.

[–] [email protected] 10 points 1 week ago

C/C++ is mildly obsolete now, basically. Breaking the memory model is not really a small defect that's a matter of taste.

[–] [email protected] 10 points 1 week ago (3 children)

Prevent what? UNDERSTANDING the code?

Yeah, Rust is quite successful in that :)

[–] [email protected] 48 points 1 week ago (1 children)
[–] [email protected] 5 points 1 week ago (1 children)

That's a rather old joke. Modern compilers print more adequate things on STL/templates related things.

And it doesn't make Rust any better.

[–] [email protected] 8 points 1 week ago

Yeah, I know, that all just a humour. I almost always use C++, inspite of knowing rust (cz no jun vacncies for rust, but still). There is no modern language which is absolutely better than other one — compromises are everywhere, that's why it's a silly topic to argue about.

[–] [email protected] 7 points 1 week ago

You do not come across as clever as you think that you are when your central point is that you personally are not capable of understanding code written in a different programming language.

[–] [email protected] 1 points 1 week ago

I feel like a really bad job has been done of making it simple, honestly. Or at least was last I checked.

Pointers allow aliasing XOR mutability. There's all kinds of nuance layered on top of that if you look in the compiler developers resources, but that's just to allow for all the different kinds of sugar people want in a modern language.

[–] [email protected] 6 points 1 week ago (1 children)

There are C++ analyzers like this which are also designed to prevent it (if you have no choice between languages).

[–] [email protected] 7 points 1 week ago* (last edited 1 week ago) (1 children)

I've seen things like this posted several times on here. It always turns out it doesn't actually catch all the possible problems, or it's garbage collected, or it's non-usable for real code.

If it was that easy, the people who wrote Rust with all it's complexity and divergence from the norm were idiots, and I really don't think they were.

[–] [email protected] 7 points 1 week ago

It's pleasure for me to write in rust, I really like how fast I can deploy a working solution (including debug time). As I mentioned, there are situations when, for some reason, you cannot do without C++. But you are right cpp-analyzers do not solve all possible problems.

[–] [email protected] 40 points 1 week ago (1 children)

Man, fraggles really do love radish though.

[–] [email protected] 5 points 1 week ago (1 children)

See? I'm telling the truth :)

[–] [email protected] 1 points 1 week ago (1 children)

I kinda want to look up Fraggle Rock to see what that show was about, but I'm worried I'll be disappointed in my former self's taste. I know I watched it when I was like 4-6 y/o.

[–] [email protected] 5 points 1 week ago

I watched it when I was 30 as a method of learning English. It wasn't too childish.

[–] [email protected] 21 points 1 week ago (1 children)

Congratulations, you've illustrated the difference between syntax and semantics. But any competent compiler also handles semantics (just in a separate phase of compilation), because that's necessary for any useful conversion to machine code, not to mention optimizations.

[–] [email protected] 1 points 1 week ago* (last edited 1 week ago)

It's more like they handle a smaller, toy version of semantics that you can actually code a compiler for. In OP, something semantically correct in that version but not by common sense was accidentally written.

Maybe an early LLM that talks about picking up fire would be a better analogy.