this post was submitted on 17 Mar 2025
1310 points (99.8% liked)

Programmer Humor

34453 readers
27 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 2 days ago* (last edited 2 days ago)

You're right, that's what I get for not having written a line of C in what 15 years. Bonus challenge: write for i in i32::MIN..=i32::MAX in C, that is, iterate over the whole range, start and end inclusive.

(I guess the ..= might be where my confusion came from because Rust's .. is end-exclusive and thus like <, but also not what you want because i32::MAX + 1 panics).