Used for questions on the science fiction genre itself, including its tropes and conventions. Should **not** be used to categorize questions about specific works of science fiction.
Science fiction is a genre with a long and storied past. The modern science fiction story dates back to the late 1800s of Wells and Verne, though earlier stories like Shelley's Frankenstein, Swift's Gulliver's Travels and Kepler's Somnium all have science fiction elements. Published in 1620 through 1630, the latter was regarded by Isaac Asimov and Carl Sagan as the first science fiction story.
Robert A. Heinlein provided a good short definition of the science fiction genre: "realistic speculation about possible future events, based solidly on adequate knowledge of the real world, past and present, and on a thorough understanding of the nature and significance of the scientific method."
The most common distinction between fantasy and science fiction (an often blurred boundary) is that futuristic and space-based stories tend to fall into the science fiction category, whereas historical and medieval stories lean more towards fantasy.
This division by setting then leads into a separation between "hard" and "soft" science fiction: "soft" science fiction is where the science itself does not necessarily stand up under close examination and tends to be a case of a story happening to exist in a futuristic setting. "Hard" science fiction, by contrast, has a self-consistent view of the future where scientific developments do not violate what we know about the universe.
There are many further sub-genres within science fiction as well: steampunk, cyberpunk, space opera and space western are just some of the relatively arbitrary divisions within the genre.