|
|
|
|
|
by maccard
2635 days ago
|
|
I can make the same argument for exceptions - You're not documenting correctly. You also have the choice to ignore and fail with exceptions. Example: you have a method which requests a file from disk, but it fails to load for some reason. With error codes, you force all callers of your resource loader to explicitly handle the failure case at the point of failure, or you lose all context on the error. If you just bubble the error up, you're manually doing exceptions. With exceptions, the code that requests a file can assume it succeeds if it doesn't have enough context to handle the erorr, and you can handle at a higher level and still know what happened. |
|