It should be noted that all Science Fiction is a subsect of fantasy. To Whit, both are based off of a pretense of ideas that are not (or not yet) a fact in our reality. The difference between Science Fiction and Fantasy is really that Science Fiction is extrapolating ideas from Science, rather than just come up. Often times this makes all Science Fiction Stories "high concept" stories (A giant "What If?" Scenario), rather than Hero's Journeys (Though that happens in Sci Fi too).
A good example of this is Pebble In The Sky, which is basically about a man who is hurled some fifty thousand years into the future, where human beings are part of the Tranton Empire (established in the foundation series) and Earth is a radioactive superslum, where humans have completely forgotten that this is the planet we come from. Now the basis of this book is the Scientific Elements that it talks about. It makes mention of the main character having hair on his face (because humans have lost beards by this point, a factor of our evolution), the main character has to have his brain augmented to speak the new language (or dialect) of the people of this world, taking note that language changes over time and it is unlikely we will be speaking the same language over time.
In contrast to this we have things like Star Wars and Dishonored, often considered Science Fiction, but because the very basis of these worlds insists upon forces that do not exist in the universe that we know it, and can be better described as magic than any Science that we refer to this as fantasy, or rather Science Fiction minus the Science, which leaves us Fantasy.
All this said, I tend to gravitate more toward Science Fiction, but that's more of a personal taste than anything to objectively do with the medium. I love Science (sometimes with my penis), so anything based off of Scientific Ideas has an appeal to me.
One thing I would like to address is this disconcerting idea that one is better than the other because they have more ability for stories. People cite the Creativity of fantasy vs. the limitations of Science (and some reason it's optimism, which is a bad thing?), or the vastness of Science Fiction vs the Tolkien Stagnation of Fantasy. These are both patently untrue, neither one of these genres are capable of more stories than the other, nor is either genre inherently Stagnant. While people point out the stagnation of Fantasy through Tolkienesk Ideas, I think you should give the following books a look at:
The Chronicles of Amber - A series of books about the true reality and it's Princes, and it's basic pretense is that all reality is a "shadow" cast from the ultimate reality of Amber. And it's Princes through the force of "Pattern" can manipulate these shadows.
The Discworld Series - A 40 book long series dedicated to being the Hitchhikers Guide to the Galaxy of Hard Fantasy, where Death is one of the Main Characters.
The Incarnations of Immortality Series - Which is about the role of Gods being an office job.
Anything by Christopher Moore, who writes about Mythogical creatures or roles in a modern day setting, my favorite being "A Dirty Job", which is about a man becoming a death.
... Is it weird that my favorite fantasy books include incarnations of Death?
Well, for the opposite camp, who find Science Fiction to be limited by reality (and too optimistic?), I would like to point out that the limitations are simply the vast wonders of the universe and creativity, so here are some books if you find Sci Fi too constraining, or unable to tell a creative story, that you Should check out.
Dragon's Egg - An interesting book about a species living on a Neutron Star, who progresses so fast the humans in orbit can watch it's civilization unfold before their eyes.
The Foundation Series - Gotta have some Asimov in here, this about the trials and tribulations of making a Galactic Empire.
The Dune Series - About a desert, almost inhospitable planet, that because of the nature of it (it is the only planet that produces Melange-Spice) it is the most important planet in the universe. THe political struggle around it, as well as the natives caught in between the struggle.
1984 - A (very optimistic) book about dystopian future (set 29 years in the past) in which a society is brainwashed by fear and doublethought and the presence of the omnipotent Big Brother.
A Door Into Summer - About a man running from his shitty life by putting himself in suspended animation for 30 years.
I Have No Mouth, and I Must Scream - A Short Story about a Supercomputer gaining Sentience, Wiping out the entire human race save for five people that it keeps alive to torture for the rest of eternity, so that their only viable escape is the cold embrace of death that it denies them. (It's so beautifully optimistic, it leaves butterflies in my stomach).
My point isn't to convert any of you with this, after all we all have our tastes. But by saying one is better than the other in any objective level, you're just being pretentious at best. The fact is there are GREAT books on either side of the fence, and I will read a Heinlein Book as quickly and voraciously as I will a Pratchett work, because I love great stories. And while ideas can get eyerolling sometimes (for instance, I'm a big trekkie, but the Roddenberry Ideal Human can go fuck himself) and some ideas can get repeated (for instance, almost every fantasy book I mentioned has Death as the Main Character), none of this means their bad, or not worth your while, or too "optimistic" for you (seriously, what is that about?).