The spear is more versatile, though. It can be effectively used in most any situation. The same can't be said for a sword. Not to mention that it can act, albeit not as well as the real thing, as a quarterstaff in close quarters.
My main point(s), I suppose, is(are):
That with equally trained opponents, the one with the spear has the advantage. With opponents of no training, the spear has the advantage. With opponents where one is trained and the other is not, the handicap favors (is lessened for) the spear wielder, rather than the sword wielder.
Now if you have a shield to go with the sword, that's another situation entirely.
Generally a one on one between a halberdier and a sword armed opponent favors the sword. A hundred halberd verse a hundred swordsmen favors the halberdiers. The spear does have a long range but also a large dead zone, once you get past the pointy bit it loses much of its effectiveness. Trying to attack a spear formation with a sword is a daunting proposition, since its very difficult to get into sword range without someone managing turn you into a kebab with a spear. One on one is a different matter
A longsword has what is called a shielding ward or Schrankhut, you hold the blade out in front perpendicular to your line of advance and can then fan the blade back and forth by rolling your right hand around your left from right to left and vice versa. When your spear armed opponent makes a thrust you can then pretty easily deflect the spear with your sword from this ward. In general I find the person reacting to an attack has a bit of an advantage over the attacker; unless your getting into armored half sword or grappling (I often get in trouble with this since I am pretty attack oriented). So most likely a swordsman will be able to deflect the spear thrust, while the blade is bound with the spear the swordsman can grab the spear shaft with the left hand make a step past the business end of the spear. Unless the spearman has a sidearm(as in a messer or dagger not 1911

) your sword wielder is only a triangle step away from doing something extremely unpleasant to your spearman.
Coincidently when attacking an actual pike formation your swordsman will also be advancing using Schrankhut in odrer to get into melee range with your pikemen. The difference being at the very least the first three ranks of pikemen will most likely be taking a knee, in port and finally in charge pike thats at least three rows in effective range of your sword wielder, more likely it will be five or six rows. In effect there are a lot of pikes pointed at you and while Schrankhut is pretty effective at sweeping them away the numbers just aren't favorable.
As for basis I take a historic weapons course we cover longsword, sword and buckler, messer, dagger and hafted weapons (spears/pikes/poleaxe). Most of our instruction is based on Hans Talhoffer's manuscripts and MS I.33 sword and buckler manuscript plus our instructor is very well versed in medieval history. Funny enough we just had a class on attacking a pike line with a longsword at the last class.
