Diana Wynne Jones said this quote

A book for children, like the myths and folktales that tend to slide into it, is really a blueprint for dealing with life. For that reason, it might have a happy ending, because nobody ever solved a problem while believing it was hopeless. It might put the aims and the solution unrealistically high – in the same way that folktales tend to be about kings and queens – but this is because it is better to aim for the moon and get halfway there than just to aim for the roof and get halfway upstairs.