3 ms·
In the Error Values Draft Overview[1], rsc provides another argument against traditional exceptions: >As a cautionary tale, years ago at Google a program writt
by ainar-g 8y ago
In the Error Values Draft Overview[1], rsc provides another argument against traditional exceptions:
>As a cautionary tale, years ago at Google a program written in an exception-based language was found to be spending all its time generating exceptions. It turned out that a function on a deeply-nested stack was attempting to open each of a fixed list of file paths, to find a configuration file. Each failed open operation threw an exception; the generation of that exception spent a lot of time recording the very deep execution stack; and then the caller discarded all that work and continued around its loop.
[1] https://go.googlesource.com/proposal/+/master/design/go2draft-error-values-overview.md https://go.googlesource.com/proposal/+/master/design/go2draf...