Re:The power of Result types in Swift
by Smaug123 on Monday June 18, 2018 @03:11PM
(#17340841)
Your phrasing ("I refuse to see…") makes me very apprehensive of trying to explain, but I'll bite.
Using exceptions is dealing with errors out-of-band. Using Result types is dealing with errors in-band. In-band is somewhat less flexible because you don't have the power to arbitrarily alter the execution flow of your program. Out-of-band is much easier to reason about by that very token.
Using exceptions is dealing with errors out-of-band. Using Result types is dealing with errors in-band. In-band is somewhat less flexible because you don't have the power to arbitrarily alter the execution flow of your program. Out-of-band is much easier to reason about by that very token.