this post was submitted on 02 Nov 2025
286 points (96.7% liked)
Programmer Humor
27182 readers
1003 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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Rust programmers writing library code
NGL, writing pure functions in Rust is fantastic. Writing responsible code that handles all the error conditions turns the "happy path" into hamburger. Even with the ergonomics of Result, Option, and even
?, code just sprawls and becomes a readability tradeoff. I'm only a few months into Rust at this point, and I have a lot to learn, but it's tempting to just.unwrap()and.expect()where I think it's unlikely to fail.That's honestly fine in your application code, but very frustrating to see in library code on crates.io. Nobody wants library code to panic over some nonessential functionality that the calling code could've recovered from.