Swords are sidearms, designed for self-defense, duels, and as last resort. They were very rarely used as main battlefield weapons between the fall of Rome and the widespread use of firearms. In general, people on foot in this period fought with some kind of polearms, from spears to dane axes to bardiches to pollaxes to pikes. Same goes for Japan, btw -- the fetishization of katanas happened after samurais stopped being soldiers and became bureaucrats. On the actual battlefield a samurai was most likely to hold a long spear or a bow.
And in Roman formations they were used in much the same way later and earlier combatants used spears: tightly locked ranks of shields, with the sword as a thrusting weapon.