OK, I'm probably one of the few people who loves both calibers so as much as is possible, there is no bias here.
I'd probably go with the .40 for a first/only between the two, but first, the positives and negatives.
9mm: It is cheaper. Not by much these days, but even marginal savings is savings and translates to more ammo which means more practice. With the right ammo it is terrific for self defense, but ammo selection is much more critical than with larger chamberings. In smaller guns it is much more comfortable to shoot, and in larger guns it can hold more ammo.
.40S&W: These days, the price difference is pretty small between the two, so I don't see price as much of a disadvantage for .40 anymore. With 9mm, the wrong ammo choice can result in pretty subpar defensive performance. The big advantage of .45ACP is that the larger bore gives you far more flexibility in ammo choices because even the worst defensive choices are as good or better than the good and best choices in some of the smaller calibers. Well, .40S&W seems to be large enough to have the same advantage.
I think the main thing it comes down to is what size gun do you want to use it in. The smaller, near pocket, subcompacts? Go 9mm as .40 may just be too uncomfortable. The bigger subcompacts and up, they tame .40S&W just fine so go with power. I have a Taurus PT140 Millennium Pro, not exactly a large gun, and I have put thousands of rounds through it and find it perfectly comfortable for any reasonable length range session.