I have a bunch of 'em. I got a 17 and a 17L; the 17L is like the G34 but longer and with a 3.5 connector. It comes with an extended mag release and slide release. The 17L is certainly more accurate (more accurate than you would expect out of a plastic pistol at that price) the trigger is lighter (more so that I've polished the parts) and the recoil with target loads is negligble. I did need to use a lighter recoil spring though --where the 17 would function fine with my target loads, the 17L needed a 15 lb'er. The velocity in the 17L is noticeably higher, it spits out the hot 9mm ammo at .357 velocities. The 17L is balanced well because Glock machined out certain parts of the slide on the inside, I don't know if they do this with the G34. For instance, the side of the slide in the rear is hollow, whereas on the G17 it is solid. The weight between the two is very similar.
For carry, I use the G17 on the hip sometimes. The 17L is just too long, if I were to use it it would be in a leg holster. Since I'm not in the military anymore, the 17L is a range pistol. A target pistol. If SHTF though, that is my pistol of choice among all others.
If carry is not an issue (you have something you already prefer) then by all means, go with the G34. If it is mostly for range work, either would do, but if competition is even a consideration, get the G34. The 17L is a little better, but it isn't legal in the stock classes. They cost more too since they only make them in limited batches (I heard they stopped for good though...).
If carry is an issue, and competition not much so, the G19 is the better choice. It has to be THE pistol the 9mm was intended for. Absolute best all around, but velocity and accuracy will suffer some.
I prefer to carry the G27 or G29, and to target shoot the G17L. The G17 sees duty as my wife's bedside pistol, target work, some carry work, and it is a good one to keep in the truck. So it is sort of the jack of all trades. A G19 would be similar, really a better choice overall.
All that said, a .40 may be the better choice. Certainly for carry or defense. The G23 is a fine carry piece, as is the G27, and the G24 and G35 are fine target pieces. You can also do better score-wise using the .40 in competition, depending on what you get into, as you can use pretty heavy bullets that are wider, and you got 15 of 'em (vs. 17 smaller lighter rounds).
As far as accuracy, out of all of my Glocks, the G17L is the best, followed by the G20. The G29 is the most accurate pistol that size I've ever shot.