Xylia
Terrarian
Exceeeept~!
It's the second best bullet based weapon in the game, outdone only by Chaingun. Megashark is rather monstrously OP for where it's placed. Even in the very end game it's capable, and can be counted as one of the better items to take on Duke with.
Only if you are going for strictly bullet weapons, I suppose.
You have other "Gun" type weapons, though, if you aren't in specific need of Ichor or Crystal Bullets. I hear people talking about the Tactical Shotgun. Looking at the wiki, it sounds like it could be incredibly nasty if you used Cholorophyte Bullets.
There's also the Candy Corn Rifle as I mentioned earlier; the said Candy Corn bounces and can hit multiple enemies and has cheaper/easier to get ammo.
The problem is when you try comparing the Megashark to non-bullet weapons... especially in the magic department and even in the melee department. It is certainly the earliest high-DPS ranged weapon, but once you start getting ahold of other stuff, I find it falls behind fast. I usually stick it in a chest as soon as I get the Stynger; another weapon with insanely easy to get ammo that does AoE damage (the fact that it drops off the easiest to kill AND easiest to pop hardmode boss in the game helps too).