.45 is better, but if I had to choose between .40 and 9mm (in a handgun) .40 wins.
In some future day, we will have 'phasers' as in 'Star Trek'.
Until then I must regard the 9mm as a .45 set on 'stun'.
The .40 seems to be doing well.
I like both calibers. Each has advantages and disadvantages.
I also really like the 357 Sig. I would put it on par with a .45 for stopping power.