I'm a fan of 40 but of the 3 major calibers (9, 40, 45) it is the most difficult to shoot well, especially for beginners. I recommend you go with 9mm as the effectiveness of the cartridges (provide quality modern JHPs like Gold Dots, HST, ect...) is virtually identical.
As to the guns you listed, both are high quality reliable firearms that will do right by you. That said, DA/SA is a more difficult system for new shooters to learn on in my opinion. So my vote would go to the M&P of the two.