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

Programmer Humor

21983 readers
1590 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
22
C++ (ani.social)
submitted 1 week ago* (last edited 1 week ago) by kiri@ani.social to c/programmer_humor@programming.dev
 
you are viewing a single comment's thread
view the rest of the comments
[–] RoyaltyInTraining@lemmy.world 6 points 1 week ago (11 children)

Except that many other languages have proven that C++ is simply terrible at providing meaningful errors.

[–] SorryQuick@lemmy.ca 0 points 1 week ago* (last edited 1 week ago) (6 children)

The whole point of a segfault is that you can’t really know anything about it. Even in rust, when you get a segfault there is no meaningful error.

[–] WhyJiffie@sh.itjust.works 4 points 1 week ago (2 children)

point is, Rust manages to give you not a segfault but a meaningful error almost all the time until you use unsafe

[–] SorryQuick@lemmy.ca -3 points 1 week ago (1 children)

If you’re getting a segfault in C++, it’s also cause you used unsafe code. It’s just not officially enclosed in an “unsafe” block.

[–] WhyJiffie@sh.itjust.works 4 points 1 week ago* (last edited 1 week ago)

the point was not on the unsafe word, but a very specific feature of Rust that helps enclosing unsafe code where the compiler wouldn't be able to 100% verify your logic. no such thing in C++. C++ does not even attempt to verify safety

your response is basically "get better at coding dumbass, I am the safety validator"

load more comments (3 replies)
load more comments (7 replies)