I don't tend to believe people who say that everyone working in a particular field are crazy and stupid. Wrong maybe. Whole fields are wrong all the time. But not because they're all crazy and stupid.
try {
doThing();
} catch (Exception1 e) {
handleError1();
} catch (Exception2 e) {
handleError2();
} catch (Exception3 e) {
handleError3();
}
Might be slower than Error err = doThing();
if (err.code === ERROR1) {
handleError1();
} else if (err.code === ERROR2) {
handleError2();
} else if (err.code === ERROR3) {
handleError3();
}
Exceptions are best in my mind when they are very coarsely-grained, and error-codes best when you need to handle very fine-grained errors. This is certainly true in the code ergonomics, but I'd be interested in seeing if it's true for performance as well.