Just my opinion, but I think you should go to a range and rent a few different guns. 9 or 40 may not be what works best for you. You may also find a different manufacturer that feels better to you. I have Glocks, 9s, 40s, a .357Sig, and a 10. I like them all, but I CCW a Springfield Armory XD-45. The grip angle is a lot different than the Glocks. Grip angle is something that can be easily compensated for at the range, but if your life depends on it, I'd rather have something that is more instinctive. The 45 is pretty new to the XD line, but the can be had in 9, 40, or 357 sig as well.
Please note: I am not employed by Springfield Armory, this reply is not an advertisement for any product they make (or import). It is merely what works for me.
In trying as many guns as you can, you may find what works for you may be something completely different, a revolver perhaps.
In all, try as many as you can, buy quality, get instruction, and practice, practice , practice. Don't forget ear and eye protection!
Good luck with whatever you choose.