I went to Glocks kicking and screaming in the late 80's - early 90's due to feeding problems caused by magazines in the S&W 645/4506 platform we were issuing as duty guns. Since that time, I've owned a great many of them in most of the calibers. I started out in law enforcement carrying revolvers in the mid 70's and ended my career carrying the Glock in 2014. As a range master/firearms instructor for most of my years, I got well acquainted with the Glock and have been completely comfortable with them. The durability, reliability and accuracy have been outstanding.
Now for the "however". I was introduced to the 1st generation M&P when they were being marketed. I bought a number of them in 9mm, .40 S&W and .45 ACP. They all worked well, but I found little advantage in them over the Glocks in most models. Once the Shields came along, Was getting close to retirement and picked up a Gen 1 Shield 9mm, then later a Shield .45. I found them to be great little pistols. When the Gen 2.0 M&Ps came out, I decided to give them another try. I first bought the M&P 2.0 compact in the 3.6" barrel. I was so impressed with the ergonomics, trigger, accuracy and reliability that I started letting the Glock numbers dwindle a bit and replaced the ones that went with M&P 2.0 models. I now have the 9mm 3.6" already mentioned, the 9mm 2.0 5" and the .45 2.0 4.6".
I still have my Gen 3 Glock 19 that I've had for many years, a Glock 48 and a Glock 43. I still like them, but I'm leaning towards the M&Ps more and more. I find I carry the Shields in 9mm and .45 most often, with my Sig P365 coming up behind.
As others have said, you really need to do yourself the favor of trying them at a rental range to formulate your own preferences. In my mind, all things between the Glock and M&P are equal except the ergonomics (based on grip angle and feel in my hand) and the trigger (in which I believe the M&P has a large advantage).