It seems to me that both types have advantages and disadvantages and that it would be prudent to have both (or all three if you have a handgun, shotgun, and rifle) on hand to deal with whatever scenario may come up.
This is my philosophy, all three.
But in terms of a surprised entry, it would be a pistol for me. Easier to use, plus it holds 15 rounds, and since I don't wear bed clothes, easier to snatch a spare mag in hand and still fire somewhat accurately.
As to the shotgun and rifle, I have them at the ready in the safe. But I would only go for them with some type of advanced warning. A shootout in the street in front of my house, the knowledge that violent badguys or prison escapees are in the area, recent break ins in my neighborhood, etc. A pistol gives you more defensive capabilities (i.e. hide behind cover and still shoot, harder for a BG to disarm you) in my opinion and is the mainstay in my HD scenerio.