this post was submitted on 01 Aug 2025
150 points (96.9% liked)

Programmer Humor

25425 readers
1996 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
 

Don't say anyway, say anyhow

you are viewing a single comment's thread
view the rest of the comments
[–] dgriffith@aussie.zone 1 points 1 day ago* (last edited 1 day ago)

I was talking more about unwrap causing a panic rather than calling the actual panic macro directly. Rust forces the programmer to deal with bad or ambiguous results, and what that is exactly is entirely decided by the function you are calling. If a function decides to return None when (system timer mod 2 == 0), then you'd better check for None in your code. Edit: otherwise your code is ending now with a panic, as opposed to your code merrily trotting down the path of undefined behaviour and a segfault or similar later on.

Once you get to a point where we are doing the actual panic, well, that is starting to just be semantics.