Republicans have for some time been attacking Barack Obama for his lack of experience. Democrats, in turn, have attacked Sarah Palin on the same grounds. Much of this is partisan posturing. Few Republicans are willing to own up to the contradiction between their attacks on Obama and their defense of Palin against the same charge; many Democrats have fallen into a parallel inconsistency.
But there is a serious general issue here: does prior experience really improve presidential performance? We have only had 43 presidents, so it is hard to draw statistically valid generalizations. It's easy to think of highly experienced presidents who performed poorly in office. James Buchanan, John Quincy Adams, and Richard Nixon are some of the best examples. On the other hand, several presidents with very little experience have done extremely well. Abraham Lincoln, whose only major elected office before becoming president was a single term in the House, is the most famous case. Among post-World War II presidents, the ones with the most prior political experience were Nixon (vice president for 8 years, prominent congressman), Lyndon Johnson (VP and powerful senate majority leader) and George H.W. Bush (VP for 8 years, various important positions in the executive branch). It's hard to argue that these leaders performed systematically better in office than relatively less-experienced counterparts such as Truman (VP for only a few months and a brief Senate career), Clinton (governor of a small state), and Reagan (governor of California, but very little foreign policy experience). Eisenhower (prominent general, but no experience in elected office), Ford (House minority leader) and Jimmy Carter (governor of a major state; member of the foreign policy-focused Trilateral Commission) fall somewhere in the middle between these two groups.
It would probably be a mistake to conclude from these cases that experience doesn't matter at all. Nonetheless, there is no systematic evidence suggesting that presidents with extensive prior political experience have done better than those with relatively little.
In my view, experience probably matters less than ideology and general political ability. The modern federal government covers so many issues that it is impossible for any one politician to have had experience with more than a small fraction of them. Even John McCain's vaunted "foreign policy" experience probably extends to only a subset of America's incredibly complex foreign relations. A successful president must rely on generalizable principles to get him through the many unfamiliar situations he is likely to encounter. That's where ideology comes in. He also needs to have a sense of the limits of his knowledge and be able to call on the expertise of others where his own is lacking. The latter is an element of general political competence. For example, I don't blame George W. Bush for lacking experience and knowledge of the relevant federalism issues at the start of the occupation of Iraq. I do blame him for failing to make adequate use of the expertise of others on this matter, which turned out to be a major error.
Obviously, a president will also need to have basic political knowledge of the type that much of the electorate lacks. Without it, he won't know enough to be able to assess or understand the advice he gets from experts. But it probably isn't necessary for him to have extensive personal experience with most of the issues he will have to address in office.
I'm not sure one can say that issue-specific experience is completely irrelevant. But I doubt that it matters nearly as much as other factors.