13 Feb
2016
13 Feb
'16
7:50 a.m.
On 2/13/2016 12:08 AM, Emil Dotchevski wrote:
If your point is that in case a function "fails" 50% of the times it's called, one should not be throwing an exception to discriminate between success and failure, I agree; OTOH in this case the "error code" vocabulary doesn't seem appropriate.
If instead I told you I had a function that is called 100k times per frame and that function returns an error code 1% of the time, would it make more sense? It returns a result<T> that holds a T 99% of the time. I don't think you would advocate throwing 1000 exceptions a frame.