The Nine Billion Names of God, et al.
Of all the genres, science fiction and fantasy are the ones where humans can tackle their deepest societal problems and thought experiments. Because of this, it’s a natural place for people to explore ideas about religion, faith, and the meaning of life. . . So begins Leah Schnelbach’s “19 Positive Approaches to Religion in Sci-Fi and Fantasy” on TOR.COM, brought via today’s post-Halloween email. I thought it would be interesting to look at some examples of books and short stories that have tackled religious questions in respectful and positive ways, she continues and, yes, “The Nine Billion Names of God,” a short story by Arthur C. Clarke is included, as is his “The Star.” Also there are Roger Zelazny with LORD OF LIGHT, A CANTICLE FOR LEIBOWITZ by Walter M. Miller, a couple of shorts by Ray Bradbury. . . . Well, and many others, some of which I’ve never heard of myself but may now consider looking into.
But why religion? That is, isn’t science fiction (at least) in some way opposed to that? Maybe, maybe not, but I would suggest that even if not on the surface, the people in a future — or fantastic — society still will still have some unexplained beliefs, that rely on faith. Perhaps it’s just custom, the way things are done, but for example (and yes, this is a plug, my novel-in-stories due out next year cf. October 31, et many al., and some stories in my other books as well) in my TOMBS stories there’s an implicit belief in the existence of souls, of some kind of life after death — there’s even some description of the nature of souls, how they themselves are made up of parts, and how souls of lovers might be later reunited. Or in horror, if one accepts vampires or ghosts or other supernatural beings, again a subtext of belief is implied, whether in formal or informal terms. So call it world building — or adding texture. But even if not overt in a story, religious assumptions may lurk in the background.
And of course, in some, they may be in the foreground, for more on which (and don’t forget to scroll through the comments too) press here.

