While I really hope to see the end of nationalism in my lifetime, I honestly don't think that it will happen. People like to feel proud of themselves, and in the absence of any real sources of pride, nationalism takes that place.
I used to work for a very intelligent, well-respected (in his field) chemist who had some odd self-esteem issues. A sort of narcissist as overcompensation, with a handful of persecution complex as icing. Anyway, he was always doubting himself inside, but was fiercely proud of his national heritage, and instilled this pride in his children. To the point where they are all (to some extent) nationalists of this nation, despite being long-term naturalized Canadians. The more confident of his kids are less so, where the least confident is a foaming-at-the-mouth nationalist. But there are other issues at work there too.
Personally, I've found the idea of nationalism a bit odd. It's great to take pride in yourself, your accomplishments, and even the accomplishments of your friends and family. But where you were born? You had no control over that whatsoever. It is not an accomplishment to be born French or Ugandan or American, and because of that I see no value in taking pride in that. Of course, being the grandchild of German post-war emigrants and Ukranian interwar refugees might have something to do with that
As with religion, nationalism is of course a behaviour which is instilled early in life, and reinforced throughout childhood. As long as parents remain nationalist, children will become nationalist. Perhaps in time this will be tempered by the biological fact that all humans are biochemically equal, but the extremist end will take far longer to extinguish, as they will see a core part of their self-identity as being under attack. People don't behave rationally in such a situation.
I used to work for a very intelligent, well-respected (in his field) chemist who had some odd self-esteem issues. A sort of narcissist as overcompensation, with a handful of persecution complex as icing. Anyway, he was always doubting himself inside, but was fiercely proud of his national heritage, and instilled this pride in his children. To the point where they are all (to some extent) nationalists of this nation, despite being long-term naturalized Canadians. The more confident of his kids are less so, where the least confident is a foaming-at-the-mouth nationalist. But there are other issues at work there too.
Personally, I've found the idea of nationalism a bit odd. It's great to take pride in yourself, your accomplishments, and even the accomplishments of your friends and family. But where you were born? You had no control over that whatsoever. It is not an accomplishment to be born French or Ugandan or American, and because of that I see no value in taking pride in that. Of course, being the grandchild of German post-war emigrants and Ukranian interwar refugees might have something to do with that

As with religion, nationalism is of course a behaviour which is instilled early in life, and reinforced throughout childhood. As long as parents remain nationalist, children will become nationalist. Perhaps in time this will be tempered by the biological fact that all humans are biochemically equal, but the extremist end will take far longer to extinguish, as they will see a core part of their self-identity as being under attack. People don't behave rationally in such a situation.