This is long, but adds quite a lot to our discussion (includes the highly regarded expert DocGKR). One large takeaway is 9mm is as effective as .40, yet offers several important advantages.
I never jumped on the .40 cal. bandwagon. Mostly to keep my reloading cost down. I think my 9mm's and .45acp's will pretty much do what a .40 cal. can do if I do my part. Nothing wrong with a .40 cal. , just not for me.
I don't discriminate. I always have a 40 S&W Shield in my briefcase, a 45 Sig P220 on my nightstand, and a 9mm Kahr CM9 in my truck console. The Shield is my favorite.