Well first off, here are the most important factors in a defensive handgun, in order of their importance:
Reliability. It must go bang when it is suppose to. If it doesn't nothing else matters.
Practical accuracy. This is the ability of the gun and the shooter to deliver effective rounds to target. If you cannot do this, the rest is moot.
Power. The bullet must have the ability to reach vital tissue deep within the target, consistently and effectively.
The handgun, the shooter, and the caliber are all important to the extent that they can answer all three of the above factors. That said, my preference in my primary carry guns is the .40S&W. I also carry, on occasion, a 9mm when I feel my immediate needs require that to be the case. Ammunition design becomes more critical as you descend the caliber latter. For my Glock 23, which is my primary carry gun, I like the Federal 165gr HST. If I am carrying my Glock 27 or my Kahr K40 Elite '98, I generally use the Federal 155gr HST.
For my 9mm needs I like the Federal 147gr or 124gr HST in +P loadings. Or the Winchester Ranger 127gr +P+ RA9TA load.
Here's a link to a long article you might find very interesting. Some people have taken issue with it, but it does bear consideration and is worth your time to read it.