r/programming • • Jul 20 '26

Throw, Result, or neither?

https://www.architecture-weekly.com/p/throw-result-or-neither
113 Upvotes

115 comments sorted by

View all comments

Show parent comment

3

u/knome Jul 21 '26

better, but still imperfect. at the point where you raise an exception, there is nothing guaranteeing who will be receiving it, nor even if it will be received. it may simply crash your program. and where it is received, it is often trivially ignored. where you capture exceptions, there is no guarantee you have covered them all, nor usually any way to check.

2

u/ericonr Jul 22 '26

there is nothing guaranteeing who will be receiving it, nor even if it will be received. it may simply crash your program. and where it is received, it is often trivially ignored

At least for this part, Results don't guarantee any of it either. I've seen lots of let _ = in Rust code, as well as careless unwrap/expect. Of course Result is a little more explicit, but it doesn't guarantee anything.