this post was submitted on 25 Jul 2023
1052 points (98.2% liked)

Programmer Humor

18418 readers
1189 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 49 points 11 months ago (2 children)

Tbf, you have to be pretty far with Rust to get to a point where Rust's compiler errors stop helping you (at least, as far as I've seen). After that, it's pretty much the same

[–] [email protected] 25 points 11 months ago

Yep use a little bit more deeply cascaded generic rust code with a lot of fancy trait-bounds and error messages will explode and be similar as C++ (though to be fair they are still likely way more helpful than C++ template based error messages). Really hope that the compiler/error devs will improve in this area

[–] [email protected] 15 points 11 months ago* (last edited 11 months ago) (2 children)

Rust has better runtime errors, too. If you run a dev build, it should pretty much never segfault unless you use unsafe and will instead tell you what went wrong and where, no valgrind necessary.

[–] [email protected] 8 points 11 months ago (1 children)

Would know, I've never had a runtime error in Rust /s

[–] [email protected] 3 points 11 months ago (1 children)

Can't have a runtime error if you don't have a compiled binary *taps forehead*

(For the record, I say this as someone who enjoys Rust)

[–] asdfasdfasdf 1 points 11 months ago

This is actually unironically a major benefit of Rust - compile time errors are supposed to be for dev mistakes and runtime errors supposed to be for user mistakes. Way easier to debug something at compile time instead of runtime.

[–] [email protected] 1 points 11 months ago (1 children)

'it should pretty much never segfault' uh, isn't that the entire point of Rust? Unless you're counting failing a bounds check as a segfault

[–] [email protected] 1 points 11 months ago

I'm confused by your comment. Yes, that is a major benefit of using Rust. That was my point.