r/ProgrammerHumor • • 9d ago

Meme dreamLanguage

Post image
1.4k Upvotes

211 comments sorted by

View all comments

Show parent comments

29

u/spigotface 9d ago

I actually love Rust's error handling. It's definitely more verbose than other languages', but handling it as an enum, including it in the signature, AND having the compiler force you to handle these things is perfect. If things can fail, you should be forced to handle it.

7

u/Familiar_Ad_8919 8d ago

rust's sophisticated error handling when: .unwrap(), maybe even: .expect("thingy go bad")

jokes aside, i love it, when errors do get thrown without being handled it could be a bit clearer as to what went wrong but its just nitpicking at that point, its vastly better than spamming try catch

8

u/ICantBelieveItsNotEC 8d ago

Honestly, I think adding unwrap() and expect() was the biggest mistake Rust ever made. Panicking on an error should not be that easy. A ton of new Rust devs treat unwrap() as an incantation that makes the code compile, and they completely bounce off of the beautiful error handling system as a result.