I know that well-behaved utilities like grep output "normal" messages to stdout, and error messages to stderr.
$ grep '^foo' file1 file2 file1:foo grep: file2: No such file or directory
When I'm writing shell scripts myself I often find it hard to decide what output and which messages I should present on stderr, or if I should bother at all.
I'd like to know about good practice: When is redirecting some message to stderr called for and reasonable, and when not?
"It depends", sure, but do you have some insights that would help me make these decisions?
In order to make this subjective question fit the format, I would like to encourage answers that address the "why", and are informed by experience and if possible backed by facts.