Why is it better to throw an exception rather than return an error code?
I’ve written about this at length: Exceptions vs. status returns, but briefly: Exceptions leaves your code clean of all the checks necessary when testing status returns on every call, Exceptions let you use the return value of functions for actual values, Exceptions can carry more information than a status return can, Most importantly: exceptions can’t … Read more