-Under Construction- Swords have been around a long time, and might be the single most badass weapon ever created.
The first swords weren't that impressive. They were just pointy metal sticks that tended to break or bend. You could stab somone with it, but it wasn't that great.
Once metalworking advanced a little bit, people learned to make blades that were not only sharp, but more uniformly dense, and less prone to breakage. Early blacksmiths made swords with a variety of metals, including iron and bronze. When they ran out of iron, they all grabbed their swords, ran over to the neighboring town, killed a bunch of people, and took their iron. Then they made more swords. Thus, military expansionism was discovered.
Swords are so cool, dragons want to hump them.
After a while, it wasn't that safe anywhere. Even if people didn't have swords, they probably had clubs or spears or something. A lot of places got to be like the hood or the old west. You had to be armed if you wanted to get home alive and unrobbed.
So, everyone wanted swords, and usually there weren't enough for everyone. You could save some money and buy a shitty sword, but most of the really good swords were owned by countries and their armies. Professional swordsmen in many countries found that there was almost always work out there. Many of them were smart enough to learn how to use other weapons too, but swords remained popular.
Before a fencing duel, remember to pull your fuckin' pants up. Like, WAY up. Also...sunglasses.
In Japan, the elite warriors developed an entire lifestyle based on combat and their swords. Following the Bushido code was hard enough, as was being good with a sword, but the samurai were expected to be good at lots of things, and become complete masters of the sword.
Not just any sword would do though. They wanted really good ones; the best, if possible. The smiths put all of their metal working knowledge into it, and found that an especially strong, sharp blade could be made by folding the metal over and over, and hammering it each time. A large sword for a samurai was called a katana, a short one, a wakizashi. These were usually carried in pairs, though not frequently used at the same time (until samurai movies came along much later). A smaller knife made this way was a tanto.
A katana was serious fucking business. It was so heavy it required training to use well, and so sharp that it could literally cut a man in half in one swing. While modern high-tech methods can now produce a sharper blade, no one has ever found better ways to make a sword by hand, and to this day, genuine Japanese blades are highly prized, and expensive.
Genuine Japanese blades are well worth the cost...especially if you are trying to cut a lot of vegetables, or get bloodthirsty revenge against a bunch of jerks...
The samurai eventually found out the same thing everyone else was finding out. Some people had guns, and they could just shoot you. Sure, they had to pack a bunch of powder, and aim, and all that, but if they hit you in the head, they might kill you without any kind of proper fight at all.
Nor did they go away. All across the planet, people began using guns to kill each other. Most people didn't really care about being honorable, or getting to walk right up to someone to kill them. Just sort of standing nearby and pulling a trigger was fine with them.
While there's probably nothing wrong with using firearms as an emergency defense, it's not exactly impressive to use them for assault purposes. They also had a nasty side effect, which hasn't really gone away. While it's possible to swing a sword at one person, and hit another, it's less likely to hurt yourself while cleaning the sword (hint: it's sharp), but still possible. However, a gun could just hit anyone if you miss. Or if you hit, and the bullet goes through the target. Or if you were cleaning it and forgot to unload it. No wonder humans like guns. Guns are about as focused in their work as the average human.