First of all, arming the pilot and copilot isn't going to do much good if it's easy for someone to break into the cockpit and surprise them. I think everyone here would agree to that. Arming the pilot and copilot is just a part--but an important one--of an overall cockpit security plan.
To be sure, it would be possible to design new aircraft such that there was no passage between the cockpit and cabin. This isn't quite as simple as it sounds, however, since it would require giving the cockpit a separate lavatory and galley, and space is a rather scarce commodity on an aircraft. Additionally, for flights which are long enough to require more than one flight crew, it would be necessary that the cabin area contain seating for all crew members. Finally, there's the problem that if either the pilot or copilot has a medical emergency, it would be impossible for anyone other than the other flight officer to provide assistance despite the fact that they're supposed to be flying the plane.
As a result, while a completely-secure cockpit might be possible, it does have some drawbacks. As a result, in most cases there's going to have to be a door between the cockpit and cabin. If the pilot and copilot are reasonably alert, however, this should not pose a particular problem provided that there's a camera/monitor allowing the flight officers to see what's going on outside and provided that the door, once locked from the inside, cannot be unlocked or forced open from the outside without giving the flight officers at least a few seconds' notice.
To be sure, the pilot's control of the aircraft can itself be used as a weapon against anyone invading the cockpit (a bit hard to ram the door when you're practically bouncing off the ceiling). On the other hand, such severe maneuvers may be severely injurious to the passengers and flight attendants (especially if things like the beverage carts aren't secured) and yet not be completely effective against the hijackers (who, being aware of the possibility, may have been trained to deal with it). A firearm, fired at the specific individual(s) raiding the cockpit, may be more effective than aerobatic maneuvers against the hijackers while posing less risk to the other people in the plane.
That's the flip side of the remarks in my last post. A gun isn't a magic talisman of protection, any more than it's a magic talisman of evil. It's a tool, which has to be used properly.