Eric S. Raymond reviewed Matthew Johnson's short-story anthology Irregular Verbs and Other Stories. He used it as an opportunity to talk about the differences between SF, literary fiction, and other genres. It caught my eye because I've been doing my own ruminating on what SF is and what literary fiction is.
I will use Johnson's work to explore some of the boundary conditions of the SF genre—how it differs from literary fiction and from genres such as mystery and fantasy.
Because I'm going to be saying a lot about genres of writing, I want to be clear on what I think a genre is. It's two things: one is a set of expectations a reader has about the kind of experience an instance of the genre will deliver, the other is a set of genre-specific codes and expressive techniques that the genre writer uses in the expectation that readers will receive them as the author intended. Like all codes and languages, the purpose of genres is to make communication easier by allowing both parties to assume a repertoire of common referents. Genre art fails when the production of the writer fails to match the genre referents and constraints as known by the reader.
This analysis generalizes Samuel Delany's observation that SF is not merely, or even mostly, a way of writing; it is a way of reading, too. The same is true of other genres, in different ways.
We will also require the following definition of science fiction (due in its most developed form to Gregory Benford): that branch of fantastic literature which affirms the rational knowability of the universe, and has as its most particular reader experience the sense of conceptual breakthrough—of having understood the universe in a new and larger way. Every constraint in this definition is important; removing or relaxing any of them lands us in other genres.
It made for some interesting reading. I also learned from the discussion in the comments.