5 ms·
Primarily specificity. I want the function to fail when it is passed the wrong arguments, but I don't really care about how exactly it fails. If the wrong type
by winstonewert 10y ago
Primarily specificity.
I want the function to fail when it is passed the wrong arguments, but I don't really care about how exactly it fails. If the wrong types get passed to a function, I'm already screwed and there's no way to do the right thing at that point. I only care that I get enough information to debug what happened.
In pretty much any other case, I want to function return some precise value or do some precise action. These are situations that the code will encounter during normal execution, and so I do care about what exactly it does.