“Didactic” literature has a poor reputation, in part because of its distinguished critics. J.R.R. Tolkien’s dislike of allegory is well-known, and his friend C.S. Lewis’s Chronicles of Narnia is often compared unfavourably to Tolkien’s Lord of the Rings partly because one is allegorical and one is not. Edgar Allan Poe also criticised explicitly didactic literature, and Lewis Carroll mocked the tendency to look for a “moral” to stories via Wonderland‘s Duchess character.
Certainly, stories written with a particular moral in mind often turn out awkward or hammy, but can we entirely discount a didactic use of fiction? After all, Aristotle points out in the Poetics that children learn primarily through mimesis (roughly, “imitation”), and he refers to drama and epic poetry as “mimetic” arts, since they’re imitations of (what is plausibly) real life. Few, I think, would deny that the best way to learn something is often through experience; the more successful businessman will generally be the one who has been in business for several years, not the one who has merely read the abstract principles of economics, and one could regard fiction as a vicarious form of gaining experience.
It’s also worth noting that abstract ideas are often taught by way of analogy in a short story, like Plato’s analogy of the cave, Christ’s parables, or Mishima Yukio’s novels. We live in a physical world, and it’s no surprise that most of us struggle with abstractions but find an intuitive understanding of things that are grounded in experience – whether our own or vicarious, and we can, even subconsciously, intuit moral principles even from works that are not explicitly meant to teach them.
What is loyalty? Sam following Frodo deep into Mordor.
What is humility? Arthur’s knights, one by one, leaving the quest for the Holy Grail as they recognise their own unworthiness of the honour of finding it.
What is patriotism? Adam Wayne fighting for the independence of Notting Hill.
Note that neither Tolkien nor the Arthurian storytellers set out to illustrate these things; they primarily just wanted to write a good story. I’m sure that Chesterton did intend The Napoleon of Notting Hill to have a “moral” to it, but he doesn’t call attention to it within the narrative; he simply lets the story speak for itself.
They are also realistic in their depictions; though Lord of the Rings ends well, Sam does despair of his and Frodo’s chances surviving their journey at a couple of points, and Arthur is ultimately destroyed by a grievous sin committed as a young man.
This is not to say that all fiction must be didactic in some way. As I wrote in this post, even though the overall tone of a nation’s literature is both a cause and symptom of its character, for good or bad, works like Poe’s and Carroll’s don’t have much to teach one way or another, and don’t need to. It’s enough that they’re entertaining.
I would still maintain, though, that the greatest literature will make full use of the medium’s power, and thus will attempt both to delight the audience and in some way uplift them.