In the golden days of muscle powered weaponry swords and especially knives were usually backup weapons and the infantryman's main weapon would be either a pole arm or a projectile weapon. The Roman legions might be the big exception, since many of them carried a 2 foot sword as a main weapon. Of course, they depended on well drilled formations to make that work.
Given the choice today, I would take a bow over a halberd or spear, halberd or spear over a sword, and a sword over a knife. Warfare tends to winnow out what's effective pretty quickly.