It was probably 1998, I had recently graduated from college, and I found myself in a car with the father of a friend of mine. We were talking history, a subject that we were both interested in, and he stated that science was slowly but surely eradicating religion. I pointed out that this didn't actually seem to be the case. He responded by pointing out that the methods of science (asking questions and testing everything, even things that seem obvious) are in direct opposition to the methods of religion (faith and tradition), and announced that he had "destroyed" my argument.
But, well, he hadn't.
Yes, there is evidence that people who claim no particular religious allegiance are growing in number (this is often referred to as the "rise of the nones"), but if you look more closely, it's not that these people are necessarily giving up supernatural beliefs, it's that they are becoming dissatisfied with the churches. In other words, it's the actions and positions of the churches, mosques, and temples that is pushing people away, not the recognition that belief in gods and spirits is not supported by scientific evidence.
What's more, even those who are loud and proud atheists often adopt belief systems that function in a manner similar to religion - complete with the group think, dogma, and refusal to acknowledge contradictory evidence. I have no problem at all thinking of numerous atheists who were nonetheless ideologically committed to Marxism or it's arch-nemesis libertarianism, and there's a huge number of people who won't admit to a belief in the supernatural and yet engage in all manner of muddied or magical thinking within worldviews based on the appeal to nature fallacy. Even in countries with very high numbers of atheists, these types of supernatural beliefs tend to persist. So, even though religion may formally have been eliminated for these people, essentially religious, dogmatic irrational thinking is still present.
And then we have the fact that a number of prominent scientists are themselves religious. If science were eradicating religion, we would expect that this would be amazingly rare. While the American Academy of Sciences is composed primarily of non-religious people, surveys of the scientific profession more widely have found that religious belief among scientists is more common than generally thought. While the number of non-religious vs. religious scientists certainly suggests that science does have a deleterious effect on religious beliefs, it doesn't seem to actually eradicate them.
His argument made sense in a purely abstract way, which is probably why it is a popular notion amongst many of my fellow atheists. I have often heard, and used to believe myself, that improved knowledge about science would lead to the eventually loss of religion from society as science increasingly supplies better answers to questions that were once the province of religion, such as "How did we come to be here, and what are we, anyway?" Also, religious-type thinking, that is thinking that assumes a wide range of essentially dogmatic and supernatural notions (which includes many political beliefs) can get further away from this by not making overt empirical claims (though such ways of thinking often have many implied empirical claims).
The problem is that religion does more than simply provide answers to questions. It orients how people view themselves within their world, and provides symbolic meaning to the world around a believer. There are, of course, other sources for these things - I make no secret of the fact that I think that there are many sources that both provide better answers than religion and do less harm - but regardless of what other sources exist, religion does do more than simply answer questions. Therefore, while scientific knowledge, which simply does answer questions, has forced modifications to religion (for example, belief in a flat-Earth, which is taught in the Bible in Ezekiel 7:2, is not subscribed to by the vast majority of Christians and Jewish people today) but not eliminated it. By doing more than simply answering questions, religious-type thinking is able to maintain a toe hold even when all of its empirical claims are proven to be nonsense.
But there's another important factor at work here: people's ability to compartmentalize their thoughts. All of us hold beliefs, ideas, and values that are inconsistent with other beliefs, ideas, and values that we hold. Sometimes we may be confronted with this fact, but most of the time we are not, and we are able to continue placing the notions into different mental boxes without ever having to confront the dissonance between them. Many, probably most, of us will even go through bizarre mental gymnastics in order to avoid having to admit that some of our notions clash with each other when we are confronted with the fact. In the end, this ability to compartmentalize allows us to continue believing notions long after they have been conclusively disproven, and more subtly, they allow us to continue to hold values and concepts that clash without ever recognizing that we are doing so.
Religious thinking may go away, but I am not hopeful of that. For all that it seems like the advance of science should quash religion, the structure of both religion and our minds would seem to indicate that it won't. Religion will change, and may become more of an equally irrational but individual notion of spirituality, but I don't think it's going away.