I try to snipe when possible, if I can pull an Obi-wan Kenobi and get the High Ground I will and use it to snipe as many enemies as possible.
However, there's a lot of times where sniping isn't really possible, so then I usually pack a rifle or smg for close ranges. If I'm dealing with hostile wildlife, or foes like ghost people, I'll use a melee weapon though to save ammo.