I have both 9 and 40 guns I regularly shoot. I train with my 40 mostly as I enjoy shooting it and tend to shoot it better than my 9mm. For carry, I will carry a 9mm when I get my CCW. Ballistics say 9, 40, and 45 perform similarly with modern JHP ammo. Shooting a 40 isn't the terrible recoil many make it out to be. I'm tall with big hands though so that makes a difference, and the gun will matter as well. I don't think I'd enjoy shooting a smaller 40 cal gun, but anything I've shot in 40 in a Full size pistol on up, is pleasant enough for me to shoot. I just got a Glock 35 and compared to my M&P40 FS the 35 shoots a touch easier due to the length I'm guessing. Last night during out range drills I was able to beat my best times ever with a 9mm, so some claiming that you can't shoot a 40 fast and accurate are not entirely true. I will say that after training with a 40 and moving back to 9mm, the 9 is much easier to shoot. I own guns that are the same except caliber ie 2 M&P full size, in 9 and 40, as well as conversion to 9mm for the Glock 35.
IMO if you are a new shooter, I would push you towards the 9mm as again it should do the job, and ammo is cheaper. I would say that the biggest issue with ANY caliber is people buy a gun, shoot 50-100 rounds and think they are good to go. I guess if it makes you feel safer, that's something, but when the SHTF and you need that pistol; I think the more ammo down the pipe the better. Preferably with some good training along with the shooting. Hell, even a 22LR will stop someone if placed right, so again buy what you want, but prepare to shoot and train if you really want to be effective with whatever pistol you end up with.