You're kidding, right? Do the research, man ! 
The pre-Marian Roman legion decisively defeated the Macedonian phalanx during a number of battles. Heres why:
a) The pikes wielded by phalangites sucked royally when marching in formation on rugged ground.
b) Once they busted past the first line of phalangites, the legionaries would chop them up with their short swords. Pikes were useless, and, being expertly efficient swordsmen, the Romans could outfight the Macedonians once they put down their pikes and drew their swords, which were their secondary weapons.
I'm sorry to revive an old topic, but some people are somewhat poorly informed about this.
First: Macedonians had been fighting other diadochi (or successors) for quite some time before the roman invasion, so they were already weakened. Also, their leaders disbanded most of the heavy cavalry because they couldn't pay for it, so the Macedonian hammer (cavalry) and anvil (phalanx) system couldn't be used properly, which was a requirement to their success.
Second: You don't pass the first line of pikes and "that's it"

as yo can see in the picture above, several ranks of pikes were turned forward, and once one (rank) was down, the first rank with pikes turned up would lower them, so you'd be facing a seemingly endless wall of pikes. You could avoid the first, even the second, with some luck, but the third would catch you. The phalanx was virtually invincible if faced head-on, you needed to outflank or outmaneuver it. That's what the Romans did, and why they did it? Because there wasn't a support force, like cavalry or light infantry (which was also required for success) there to stop it.
-------------------------------------------
Back on topic: couldn't a pike/spear be used for charging the enemy? Not saying it was, just asking if it couldn't if someone wanted to. I could act like a cavalry charge... downside: no horses, so less power; advantage: more men in one place, and more men in general.
I believe swordsmen, when in formation have one main goal: closing on the enemy as soon as possible. If the enemy can keep the distance, you're dead, if you close in, they're dead. They have a secondary goal: disrupt the enemy formation. Swordsmen can fight very effectively in loose formations, while many other types of soldiers can't, especially spearmen, the most common of all troop types. Also, a skilled swordsman is virtually invincible in 1v1.
Swords are famous because they were used by the nobility, and who writes history? The nobility.