According to those gents the 40 and the 45gap are one their way out the door and in 20 years they'll be gone.
While I might agree the 45gap is on life support, I see no evidence the .40S&W is going anywhere anytime soon.
While the 9mm is perfectly fine for civilian SD, my understanding is the 40 was adopted by LE for it's ability to penatrate car doors and windshields. Cops at times are shooting perps using cars as weapons. The 9mm just wasn't getting it done. Unless you feel you need to shoot thru car doors or your planning on handloading, I would buy a 9mm.
From a handloaders' point of view, I like the .40. I think it's more accurate [IMHO] than the 9mm, but can't really back that up with facts. I just like it more than 9mm. I can load it down to 9mm and pump it up for competition.
That said, I carry a 9mm single stack most of the time. My comp guns are 40 and my target guns 45acp.
Anybody telling you the .40S&W is going away in 20years, is shear speculation on their part.