Well, will pass up the chance to make cutting remarks about "Tupperware"
and you could make worse choices than 9mm OR 40 cal.
To be real direct- for a defensive arm- when you need it, you will be likely to need it bad- and RIGHT NOW. Having to draw, rack the slide, hope a round fed properly, and slide is fully in battery, etc- is not a confidence-inspiring thought- especially if the world around you is turning to ca-ca.
Most of my CCW is a revolver (my motto- Wheelgun- when it absolutely, positively has to go BANG the first time) However, I DO carry an auto on occasion- Round chambered, cocked, safety on) Design of the Glock is intended to be carried safely with round chambered.
Yes, recoil on the 40s is snappy- there's that pesky action/reaction thingy. Ammo price and AVAILABILITY is a point to consider if you plan to shoot this one (and IMHO, any CCW gun SHOULD be shot- a lot) If you are looking at reloading, I would personally shy away from the 40- rather tight range of loads- gotta have enuff UMPH to make it cycle, but it is getting close to max, etc) 9mm has some more leeway on load data.
Really, it comes down to what you like, and what you shoot well. That's why Breyers makes 31 flavors. DO see if there is a range around that RENTS handguns for use at the range- try some of each, see what floats your boat.
And while you are at it, drop $150-200, and get a USED Ruger Mk 1 or Mk 2, 22 auto. Great little target pistol, 22 ammo is still a bargain- and you will shoot more. (and after putting 200 rds of 22 LR down range, my hand does not hurt) And the more you shoot (anything) the better you tend to be.