I've heard that it's a good practice to return only true or false (1 or 0) functions, however, if I create a function that checks a string, and I want to know which errors occurred in it, I usually return different values, for example:
RETURN 1 - If the string contains a number.
RETURN 2 - If the string contains special characters.
RETURN 3 - If the string contains any letter 'a'.
So my question is, would this be a bad programming practice? And if it is, how else do I return a certain error from a function that checks a string (for example).
NOTE: I return different values to display a more intuitive and user-specific error. I do not want to just return 1 to say "There is a mistake", I mean what is the error that happened, so I return 1, 2, 3 ....