For close-in fighting....in the dark....where you know the terrain, a sword is a better weapon than a handgun.
A sharp blade will quickly "disarm" an intruder without killing him.
Try having a sword in NYC and see what happens if the cops know it. Our penal code is like 18 pages on whats banned in regards to swords, knives, daggers, etc.