this post was submitted on 02 Nov 2025
302 points (96.6% liked)

Programmer Humor

27224 readers
1063 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
you are viewing a single comment's thread
view the rest of the comments
[–] arschflugkoerper@feddit.org 24 points 4 days ago* (last edited 4 days ago) (2 children)

.expect("Go fuck yourself.")

[–] Qwel@sopuli.xyz 3 points 3 days ago

"c'mon I just checked that three lines ago"

[–] Strawberry@lemmy.blahaj.zone 5 points 4 days ago (1 children)

Rust programmers writing library code

[–] dejected_warp_core@lemmy.world 4 points 3 days ago (1 children)

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.

[–] Strawberry@lemmy.blahaj.zone 4 points 3 days ago

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.