> Expected: user enters invalid data > Unexpected: function must be called with a non-empty string, and someone didn't These seem like the same thing, I don't get why they are treated differently.
A user can't prevent a programmer from calling a function with a non-empty string, a developer however can ensure the arguments are valid before calling a function.
In both cases there is something the developer can do. Only in the 1st case is their something the user can do, but only if the program informs them of the problem.
BUT! And this but is something that really gets up my butt. If a programmer spits out a thousand non-fatal errors that I can't do anything about, I'm likely to miss the one error I can do something about. So that's also an important distinction between these 2 cases.