These are some of my favorite guns for protecting your home:
Ruger P95
Ruger SR9
Stoeger Cougar 9mm
Bersa Thunder Pro HC 9mm
Smith & Wesson M&P 9
I believe for a nightstand gun and shooting at the range you can not go wrong with any of these guns.
:dancingbanana
Those will work but I tend towards larger calibers due to shorter in home distances and my ability to be quick and accurate with the larger bullets. When it comes to home defense when gun size and weight do not matter i go big.
.44 Mag Ruger Alaskan ladec with Speer Gold Dot short barrel .44 mag
.44 Spl Charter Arms Target Bulldog loaded with 200 gr. Blazer Gold Dots
.357 S&W 686 Plus loaded with .38 spl +P Gold Dot Short Barrel
12 gauge Mossberg loaded with 7 rounds of Federal Home Defense 00 Buckshot with 10 Benneke Black Magic Slugs standing by used for bear or other big creatures.
In my desk drawer in my home office I have a large folding Knife with seatbelt cutter and car window breaker. Also a 4.5 million Volt stun gun, tactical pen

, neck knife, NAA .22 mini revolver and collapsable baton. I like options to fit any occassion and threat. I am not paranoid or think that I will ever need any of that stuff. I just have been collecting weapons of all types for most of my life and might as well make some of them more accessible than they are in their storage cases.
I put my 9mm's in my pocket these days but used to use a Glock 19 and 9mm Sig P229 for home defense. With a 9mm I want at least a 4" or thereabouts, sized barrel.