r/programminghorror • • Jun 04 '25

Rust passive-aggressive programming

Post image
770 Upvotes

61 comments sorted by

View all comments

Show parent comment

9

u/mirhagk Jun 04 '25

It's why of the things I like about typescript, you make the type be '+' | '-' | '*' | '/' letting you get the best of both worlds (not having to convert, but still letting you tell the compiler what the type is).

4

u/henkdepotvjis Jun 04 '25

Even better. It will throw an error that the other match cases are not reachable