For me, the 40 is just too snappy, hard to get back on target, and flinch too much. While I have no doubt the 40 is more gun, I will have the 9mm in my stable.
I will list the "pro's" of the 9mm, some one who owns a 40 can give you their list of pro's.
Less cost to shoot.
Cheaper to reload.
Typically higher ammo capacity.
Universal round, easier to find in a shtf situation.
More guns to pick from.
Larger selection of loads to pick from.
Guns available in pocket sized.
Reliable stopper---as pistols go.
Probably several important ones I have left out, but it does offer a lot.