As Fly said there really isn't a gun that's "better", just what fits the situation or your play style more effectively.
Better gun helps though. I play Demoman, Heavy, Medic, Pyro, and Engineer depending on the map and whether we're attacking or defending.