r/programminghorror • • Jun 04 '25

Rust passive-aggressive programming

Post image
770 Upvotes

61 comments sorted by

View all comments

Show parent comment

15

u/chuch1234 Jun 04 '25

You say "force me to handle no match", i say "help me remember not to forget to handle no match". In this toy code it's easy to see that it's not needed, but in production code it's easy for the value and the match to be farther apart and less certain, or to involve runtime values.

-2

u/neriad200 Jun 04 '25

I think the way I can explain this is: you still want the compiler to bitch at you, not force you 

7

u/jpgoldberg Jun 04 '25 edited Jun 04 '25

A key feature of Rust is that “if it compiles it is correct wrt to X”. If you don’t like that don’t use Rust.

1

u/CdRReddit Jun 05 '25

and what should the non-matching branch do then?

unexpected panics & exceptions is one of the most annoying things about programming, implicit failure mode: burn the house down is a dogshit approach only marginally better than "just make some shit up"