3 ms·
> Until your coworker comes along and accidentally refactors the code to skip the exception catching and it suddenly blows up prod. can't my co-worker just use
by Quarrelsome 5mo ago
> Until your coworker comes along and accidentally refactors the code to skip the exception catching and it suddenly blows up prod.
can't my co-worker just use this pattern and discard an error result the same? I'd argue its easier as the stack wont unwind by default because the error is returned instead of thrown.
- Akronymus 5mo agoNot quite, as the compiler wouldnt let let you use the "value" in that case. So if you discard the error path, you simply wont have any value to use further on in the code.