About a year ago there was a video going around the net of a home invasion that happened in Pheonix. Two armed men come running in through the garage, and the home owner defended his place with an AR. IIRC, he wounded several of the attackers and may have even gotten the guy who was waiting in the car as a get away driver.
IMHO, if you are planning on only falling victim to the thief that is going to come in alone and only wants your stuff, then don't even buy a gun. It is probably only going to get stolen from you, and you are not going to be mentally prepared to handle a situation where you are required to use it.
I believe that if you are going to arm yourself with the goal of defending your home, you need to have a realistic plan (including possible threats) and know how you are going to defend yourself.
How are you going to react when someone starts kicking your door in (or is already in your house). How quickly can you get to your weapon? Is that get-away driver going to hear shots and haul ass, or are you going to be ready for him too when he comes in to help his buddies? Are you going to be reloading your 5 shot pistol with mini-shotgun shells when the 2nd wave comes in?
Personally, I have 3 weapons located in different parts of my house that I can get to quickly if I need to. I shoot (on average) 100 rounds a week.
There are a lot of ways to skin this cat and "be ready". Weapon choice is important, but will quickly become useless if you don't have a plan and/or don't know how to operate the weapon. Virtually every time I go to the range there is someone in there who is shooting a pistol that they bought 5 years ago, has no doubt been sitting in their nightstand, and they can't hit center mass from 15 feet. How the hell is that person going to defend their house in the middle of the night?
If someone thinks that having a gun is going to help them sleep at night, send them to their doctor and have them get a script for Ambien. Hope defense starts with midset and is backed up with training and planning.
Pardon me while I check my dry good stores, count ammo, and keep a lookout for black helicopters.