Tuesday, October 08, 2019

Why I prefer exceptions to error codes

Why I prefer exceptions to error codes:
Error codes are far safer for well-reviewed, critical code ...for most code, failing early [with exceptions] is better simply because it always makes debugging easier – even if it doesn't make the impact of the error smaller... With an exception, you get a call stack, and an error string from the bottom layer.

No comments: