I have a 50 commando and an almost-50 vanguard (yeah, I love the class that much).
If you want ranged DPS and plan to raid/etc, commando is your *best* choice. The VG is not capable of putting out the same DPS as the commando, especially in fights with adds that require AoE. That's when VGs really fall down hard.
Having said that, you'll be able to do normal raids just fine. Hard modes may be still somewhat ok, but your crew will probably be picking you up. IMHO, I don't think any group will want a VG dpser for nightmare mode.
The VG is more optimal in melee range. As a tank, you'll want to be right up close for max efficiency. The "ranged tank" ability is really about 10M out tops, but you lose stock strike for example, which is a staple in your rotation.
But hey, do what I did. Roll two troopers and own the class. I must say I enjoyed the 2nd time through because I went darkside on my VG and didn't have to put up with all the stuff like "yeah, you just tried to kill me and destroy the Republic, but it's cool man."