I agree with the majority here.
For HD a long gun is better as the main gun. A shotgun is reliable, a good stopper, with the right loads it doesn't overpenatrate, and being a long gun (long sight radius) its accuracy is more forgiving under stress. It is also pretty cheap (well under $300 for a pump gun, and often closer to $200). A .223 carbine or pistol caliber carbine (esp. the revolver caliber lever guns) would be good too. More power than a handgun (the revolver calibers really benefit from the longer barrel), the .223 has less penatration than most handgun rounds, longer more forgiving sight radius, etc.
For a HD handgun, the revolver is usually my choice (for myself as well as what I suggest to others). They are simple, if you are awakened at 3am by some noise it is quicker to action to have something you can just pick up and look at and know it is ready to go- no worries about whether you chambered the round, the safety or anything else. They are also usually far more reliable and take to being left sitting for long periods better (the auto has mag springs that will eventually wear out if left sitting, with the revolver, while it isn't a good idea for other reasons, you can leave it sitting for years and you can still be confident it will "go boom" when you need it).
For a first and/or only handgun I also suggest revolvers (and yes, I lived by my advice here too, my first was a .38spl Taurus 82). They are simple to use (fewer levers, safeties, and other things to worry about) so there is less to go wrong. The DA and SA modes are quite obvious and deliberate so it is easier to really get the workings of both. Then, in .357mag chambering, there isn't really anything as versatile. Cheap .38 plinking/practice rounds are available, decent .38spl defensive ammo is out there, good .38+Ps and powerful .357mag defensive rounds through even more powerful .357mag hunting ammo is available. A .357mag really can be adapted to just about any need. Also, should he someday choose to reload it is easier not to have to chase after the brass.
Also, as said before, for HD barrel length isn't as important since concealment isn't an issue. Go with no less than 3" for good performance out of the ammo (short barrels cause it to lose some velocity and power). A 3" is also quite handy and should he ever decide to carry is quite concealable. Still, if he'll never carry the 4" is also a good way to go and you get a little more power (and if he ever changes his mind it is still concealable). I wouldn't go above 4" for a beginner just because it starts to get a bit heavy. I think the 3" or 4" for an only gun is far more versatile than the alternatives. That said, up to a 6" should work fine for a beginner or only gun as well.