Re:You’re better off using Exceptions
by AstralStorm on Tuesday February 04, 2020 @12:01PM
(#22237955)
On the other hand, do you really want to bubble error results through layers of network stack and parsers, when handling is almost always the same?
It's a fine approach for prototyping but we should be highly suspicious of it for code people rely upon to work. As complexity approaches infinity, the odds of the system being "happy path"-aligned approach zero.
Network-relevant programming (such as web UIs), in particular, really highlights this fact (since any given network request is always allowed to fail, and "user closes their laptop or mobile device, moves somewhere else, and resumes work on an entirely different physical network" has gone from a rare occurrence to an extremely common one in the past two decades).