I say: Why not use both?
Let’s look at what each does well and doesn’t do well.
Pistols are handy to have on you and are good for moving about and performing other tasks where a free hand is needed, such as opening open doors, leading other people to safety and/or holding a flashlight. But they’re kinda lacking in the firepower department compared to a long gun.
A shotgun or a rifle brings A LOT more firepower to the table that a handgun just can’t match, but unless you’ve got an Ithaca Auto & Burglar by your bedside, you’re going to need both hands to work the gun. An AR-15 makes a dandy home defensive firearm, but be warned: They are LOUD in enclosed spaces. If it’s legal to do so where you live, consider buying a suppressor, elsewise, some active hearing protection for you and your loved ones might not be a bad idea if you’re thinking about an AR-15 for home defense.
I have a Mossberg 500 in my safe room loaded with #4 buckshot, and I have a pistol (usually one of my CCW guns) on or near me at all times. The shotgun is for defense of the safe room, and the pistol is there to move around the house if needed. On my shotgun, I have a shotshell holder with extra buckshot and a few slugs. I figure 13 rounds or so rounds of #4 buckshot*, a couple of slugs plus the content of my CCW pistol(s) will be enough to stop most threats outside of a rampaging bungalow or at least enough to hold them off until help arrives.
I consider both a shotgun and a pistol to be integral parts of my home defense plan, much like I consider a fire extinguisher and a smoke alarm to be parts of my plan for a home fire. Each has its role to play in keeping me and my family safe. My primary plan is to get everyone to the safe rom ASAP and wait there with my shotgun until help arrives. If for some reason I need to move about my house, it’ll be with a pistol and a flashlight if it’s at night. I don’t want to go from room to room clearing my house: I’ll leave the professional tactical work to the professional tactical people.
Recently however, I noticed a flaw in my thinking. In my safe room, I had the means to stop a threat, but I didn’t have the means to stop bleeding. The nearest first aid kit to my safe room was downstairs in the hall closet.
Now in my safe room, I have a first aid kit and a bunch of Israeli field dressings and copies of my driver’s licence and CCW permit for easy identification if (God Forbid) I needed them. I keep an old unused cell phone nearby as well, because any working cell phone can call 911, regardless of whether it’s on a current plan or not.
I keep all this stuff in our safe room because I don’t want to clear my house, going from room to room with catlike stealth: I want to get my family to my safe room ASAP and keep them safe, healthy and secure until help arrives.
*Why #4 instead of 00 buck? I live in the suburbs, and over-penetration through thin drywall into other houses is definitely a concern of mine.