Well, think about it this way: The engineer isn't meant to be running around getting into gunfights.
If your opponent has an assault rifle, you should reply with a .30cal. If he's got a rocket launcher, respond with a 120mm cannon. In other words, get in a vehicle. The whole point of the engineer kit is that you can keep your machinery running long after others have to abandon them.
For example, if you get in a tank duel, it's likely that if you win you've still taken a hit or two, and your tank is on the verge of falling apart. Now, if you're a Sniper, you probably need to abandon the tank and head off on foot. Not so if you're an engineer, you just jump out, apply the magic wrench and hop back in to continue the killing.
The only time an engineer needs to have his gun out is when some red-capped lunatic runs up behind you and starts duct-taping high explosives to your rear end. That's when you jump out and nail him with your designed-for-extremely-close-combat weaponry. You don't need range, you just need to be able to kill someone who's right beside you.
And if for some reason you want to play as engineer without using vehicles, well, the above comments are all accurate, the shotguns are lethal up close, you just need to be clever about things. And don't forget that you've got grenades too. Plus, there's always the pistol badges to earn. Oh, and you've got landmines too, dontcha'know. Very handy.
So, loads of useful options there, quit complaining and go fix some armour!