I'm curious. After reading some other questions, I've been pondering about the frequency and reason for happy endings. That is, a positive and/or hopeful ending, even if not everything went right, such as the protagonist sacrificing themselves for the good of those around them.
I think personally, I don't like the idea of a negative or hopeless ending because as a reader essentially trying to be entertained in some fashion (intellectually, imaginatively etc), I would rather be left feeling positive at the end of a story. Something good has to continue on or else it can make me feel strange afterward.
An example of a movie with an ending not unlike this is The Departed. By the end almost every character you thought you were emotionally invested in gets gunned down, even the good guys like Di Caprio's character and the sole survivor wasn't a major character in the story and certainly wasn't the nicest guy on the block (at least as far as good guys go).
So my question is, how often does a story end badly for the protagonist or the "good guys"? And how does it affect you as a reader?