I personally would advise the .40 be avoided. Obviously to each their own, and the best test is to go to the range and do some shooting. People like what they like, so if .40 ends up being the one you like great but:Forget both, go with a .40.
Here are my thoughts and experiences:
9mm is a small caliber low power round like the 38 special (Ballistically it's almost identical) Small caliber low power rounds are not good for much of anything but range shooting. So if you wish for anything other than a fun gun to shoot at the range I would discount the 9mm. Our police officers are far too often forced to carry 9's, because for some reason the .45 is considered too dangerous to shoot someone with (I don't get it) The .40 has become very popular because it is far superior to the 9 mm, but doesn't have the negative political stigma that the .45 has. In other words the .40 does the job but for some reason people aren't as scared of it. If I had to chose between a 9mm and a .40 I'd definately go with the .357 Sig.
Every .40 I ever shot had as much or more recoil than the same model pistol in .45 ACP. So to me you give up some size and power while still tolerating the recoil and noise. The .45 ACP is a long standing proven round, The .40 is by all respects a good round. but all things being equal why give up the size and power while still tolerating the noise and recoil.
You can get higher capacity magazines in 9mm and .40, but then if you have enough power to do the job in the first place, additional extra ammo isn't a concern.
Either way the .40 and .45 are both good rounds, I just can't see ever owning a .40.
Another option to look at would be the .357 sig. I've only fired a handfull of them, but the seem to have all the pros of the .357 mag without the recoil, and they feed well through a semi auto.
I generally do all of my recoil testing with my Daughter. I don't notice the subtle differences as well as she does. She handles her .45 well enough, but likes the .357 sig much better. She did not at all like the .40
Dave