I will buck the trend and say go with the .40. I have, and continue to believe that the .40 is the best self defense round available today. You get a round with a proven track record that will fit into smaller frame guns and still carry high capacity.
The defense of 9mm being "as good as" the .40 is filled with contradictions. You will hear that the 9mm has lower recoil, making it easier to get follow up shots. The same people will tell you to load your 9mm in +p or +p+ to ensure stopping power, raising the level of recoil to .40 levels or perhaps even higher. So, you practice with a low recoil load and save the hard recoiling load for when you are under life and death stress. Not the ideal IMO. It seems only a matter of common sense that it would be better to adjust to more recoil at the onset with a bigger caliber. A .40 is going to give you more power without having to move outside of it's standard recoil and power characteristics.
Also, 9mm defenders will justify the selection with the cost of ammo, but when you start talking defense loads, ammo cost considerations go out the window, with the "what is your life worth" argument. I actually agree with that argument, only, I think it applies to everything in regards to your self defense weapon. If my ammo costs $2 to $5 more a box to get a better round with a stable recoil pattern in practice or defense loads, I am going with that round. Again, another win for the .40.
Now, I am not bashing the 9mm, but I would only go with it in a very small platform gun, or if I were comfortable with its ability to stop an assailant WITHOUT having to move to exotic high pressure loads. If meet one or both of those criteria, go for the 9mm, otherwise, go bigger.
I think of the 9mm as a target or pocket pistol round, the .45 as a 1911 round, and the .40 as a SD round.