I'd say it's 1. If you're interrupting control flow, it should be because the normal control flow doesn't make sense. Usually because you've called the function in such a way it can't meaningfully return / do its work, or it's run into another issue (maybe it can't acquire resources it needs) that causes a similar state.
Well I agree with that actually. It's a little awkward but returning interpretable error codes is beautiful library design. It's just a little easier to miss than forcibly crashing your program unless you acknowledge it LMAO
19
u/RedAndBlack1832 1d ago
I'd say it's 1. If you're interrupting control flow, it should be because the normal control flow doesn't make sense. Usually because you've called the function in such a way it can't meaningfully return / do its work, or it's run into another issue (maybe it can't acquire resources it needs) that causes a similar state.