Out of the two I prefer Glock. I have two Glocks, a G19 that is my EDC and a G34 range only gun. I also picked up an M&P VTAC, because I had the same question as you and really wanted to see how I liked the M&P. Stock, I like both of my Glock's better. There isn't anything really wrong with the VTAC, I just prefer Glock, plus my Glock's tend to eat any ammo I throw at them while staying accurate, while the VTAC doesn't seem to like reloads at all. No problems with FTF or FTE, just accuracy that goes into the crapper. I also don't like the VTAC sights much. Paid the extra money and kinda wish I hadn't. Oh well, live and learn, that's what the experience is all about! Between these two, the M&P is the winner for price. I've seen them online for $439, a full $100 cheaper than a gen 4 Glock, about $60 cheaper than a gen 3 Glock.
That said, I add a third option, the Walther PPQ. Again, comparing these stock, the PPQ has great ergos, good factory 3 dot sights and the best trigger on a center fire pistol. My Glock 34 was my favorite gun until I bought the PPQ, but the PPQ is more fun to shoot and more accurate. I have the 5" long slide version, but I've shot the 4" version and liked it just as much. The 4" version can be had online for about the same as a gen 4 Glock (around $450 or so). Not as many accessories and such as with Glock's or Smith's, but I prefer the PPQ myself.
Careful, I'm pretty sure there's still some 1911 guys on here.
wtburnette mentioned the PPQ. What everyone should be asking themselves is why they don't own a PPQ. Find one, shoot one and you will know why I say that.