I've never shot the 17, just the 22 and 27. I am partial to the .40 since that was the first duty weapon I was issued and I do not buy additional calibers so that everything I own feeds the same caliber. In the end it's simply personal preference though, I've never met a Glock I didn't like
If you could only have one, I would go with the G17. Practical for the range since the ammo is a little cheaper. The are great SD loads for the 9mm. You can get ammo for a 9mm anywhere. With that being said, get both.
I have owned both and competed with both. Honestly, you can't go wrong with either. My personal preference is the g-17 for versatility, cost, capacity, shoot ability, and the ability to use the factory 33 round G18 magazine.