I have both Gen3 Glock 22 and M&P40.
Ergonomics - hands down M&P, especially your first grip "ooooaaaahhhh, that's nice fit" and 3 insert sizes for custom hand fit. I can reach everything (mag release, slide release) on the M&P without having to adjust my grip. Mag release on M&P is way more positive than Glock, which I have to twist in my hand to push down for positive release. For weak-hand shooting, having ambi-slide release is a bonus for me.
Recoil - M&P will provide "softer" recoil than my Gen3 Glock 22. I have shot several hundred thousand rounds out of Glocks and feels very comfortable with the recoil, but M&P's captured flat recoil spring set with full-length guide rod does a great job. I think it provides more straight back recoil.
Trigger - I do like the 4.5 lb factory Glock trigger over the M&P factory trigger, which is heavier. The Glock striker is very consistent pull after pull in producing tight shot groups and fast double-taps for matches. BUT, change out the M&P trigger with
APEX or do a
trigger job and you'll have a light 4 lb trigger that is cleaner/smoother than Glock.
Magazine - Hands down M&P - always drops free no matter what your pistol tilt angle is.
Sights - Yeah, Glock still puts plastic sights on Glocks ... but they work for me.
Barrel rifling - Conventional land/groove rifling of M&P allows carefree shooting of lead reloads. I use Lone Wolf barrels in Glocks to shoot lead reloads.