For PVP, the sniper rifle is excellent. (With buffs and a high damage ranged setup, one can 1-shot players most of the time, even with the max hp of 600.) Unfortunately, you can't be in shroomite stealth while mounted anymore.
PVE seems more relevant, since PVP balancing has clearly never been a high priority.
The damage/defense calculations in Terraria help balancing very well.
Let's say two weapons have a raw DPS of 1000. A pistol fires 10 times per second for 100 damage each, and a rifle fires 1 time per second for 1000 damage. The sole difference is the ratio of fire rate and damage per shot. The pistol's DPS is based more on a high fire rate, while the rifle's DPS is based more on a high damage per shot.
In most games, the pistol would always be a better choice,
disregarding ammo consumption and precision. Why? Because the pistol is more
flexible; with crowds of low-HP mobs, the rifle would be wasting overkill damage on each enemy, and while DPS is a good statistic to compare, what we really want is a high rate of kills (but we use DPS since mob HP varies). But on a single high-HP mob, the pistol also has no disadvantage, and may even kill slightly faster since there may be overkill damage with the rifle. (Example: for a 2100 hp mob, the rifle takes 3 shots, for a total of 3 seconds. The pistol takes 21 shots, for a total of 2.1 seconds.)
Terraria balances this by making defense subtract from the per-hit damage instead of act as a percentage. (Excluding the endurance potion, worm scarf, and frozen turtle shell.) This makes weapons with more of their DPS based on low use times
less effective for mobs with defense, up to a certain point.
Let's have a mob with 100 defense in normal mode, where half of the mob's defense is subtracted from the damage of each shot:
Rifle: 1 shot/sec (1000 Initial damage/shot - 50) = 950 damage dealt
Pistol: 10 shots/sec (100 Initial damage/shot - 50) = 500 damage dealt.
However, in extreme cases of high-defense, the pistol is more effective. When both are reduced to 1 damage, fire rate and critical chance (chance to double damage
after defense reductions) are all that matter.
Given 1 second of attacking a mob with 5000 defense:
Rifle: 1 shot (1000 Initial damage/shot - 2500) --> 1 damage dealt. (Values round up.)
Pistol: 10 shots (100 Initial damage/shot - 2500) --> 10 damage dealt.
But there's another factor to consider. Ammunition.
Ammunition damage is simply added on to the weapon damage. However, weapons with more of their DPS based on a high fire rate will benefit more from high-damage ammo, since this acts as a flat increase to their damage/shot.
With bullets of 10 damage:
Rifle: 1 shot/second (1000 Initial damage/shot + 10 damage/shot) = 1010 DPS
Pistol: 10 shots/second (100 Initial damage/shot +10 damage/shot) = 1100 DPS
There's no clear winner between two weapons of equal DPS, with the only difference being Damage/shot vs. shots/second. It's dependent on defense, bullet damage, exact mob HP, etc.
And of course, there's the more practical aspect to consider. With the rifle, for any mob we could 1-shot, the kill time wouldn't be 1 second, really, it'd be near-instantaneous. This may be why some think the sniper rifle seems OP, since almost every common mob will die in 1 shot when wearing endgame ranger armor, and this is the effectiveness people often look for outside of invasions and boss fights.