David Maraniss, an associate editor of The Post, is the author of “Barack Obama: The Story” and “First in His Class: A Biography of Bill Clinton.” This column is part of an occasional series on the 2012 presidential candidates’ political lives.

Jeff, I really enjoyed debating with you. You’re a nice dude and fun to argue with. Since neither of us took it really seriously.

— Barry Obama, 1978 high school yearbook

The president clearly won his first debate, but that was 34 years ago, when he was a junior in Mrs. Weldon’s speech class at Punahou School in Hawaii.

The topic was gun control and, on a lark, Barry Obama decided to take the side against gun regulations. He went into the debate cool and easy. Jeff Cox, his opponent, spent weeks compiling statistics, memorizing arguments, rehearsing his presentation. And then, he recalled, “Barry got up there and he just had a few arguments I hadn’t thought of. . . . He was very good on his feet, thinking more strategically on what could benefit him. . . . I felt he formulated in his own mind — while we were doing it — a kind of angle or wedge that was different than the angle I had been going. I was literal — one, two, three, four — and he kind of did some audibles.”

Obama’s high school pals, supremely confident about his debating skills, were not the least bit surprised. One of them drew a sketch for Cox with the caption: “Barry . . . You . . . Bang, Bang, Bang.”

What a distance from then to now. The only possible similarity between that long-ago performance in a Honolulu classroom and Obama’s recent showing against Mitt Romney might be the question of whether he took either debate “really seriously.” The cool fluidity, the improvisational ease, the unexpected angle that could throw off his opponent — those skills were barely evident in Denver. Many of the president’s supporters, confident going in, seemed shocked by what they witnessed, their sentiments ranging from fury to anxiety to depression.

The media response reminds me of Eugene McCarthy’s observation that journalists are “like birds on a wire” — all flapping and twittering off in the same direction at the same time. Meanwhile, partisans watching debates are like baseball fans during the playoffs, hyperventilating as they vacillate between ecstasy and despair, depending on each game’s outcome. And like sports fans, many would rather excoriate their side for a loss than credit the other team for a win.

As Obama attempts to regain his equilibrium in the lead-up to Tuesday’s debate, questions persist among his followers. What was he thinking? Why did angles of attack that seemed so obvious to others elude him that night? Can he figure it out and get his magic back before Election Day?

These questions are odd echoes of the laments about Bill Clinton after his sexual relationship with Monica Lewinsky was revealed. With fury, anxiety or depression, Clinton’s believers would ask: What was he thinking? How could he not see the dangers that were so obvious to everyone else? Can he find his way through this?

The parameters of their dilemmas are vastly different, but the answers are similar, centering on a common theme rooted in their histories. With Obama and Clinton both, strengths and weaknesses are inextricably linked. The same qualities that carried each man to the White House cannot be separated from traits that can give them varying degrees of trouble.

Clinton was a president with an irrepressible appetite for life who needed to be loved, had an aversion to being alone, was unmatched in his ability to take the temperature of a room, could operate on many levels at once, and had a remarkable capacity to survive. Time and again he planted the seeds of his own destruction and then found ways to recover. The notion that he wasted his potential by making trouble for himself is both true and beside the point. The productive Clinton might not have existed without the profligate one; they were part of the same package.

Obama also comes with competing yet connected impulses. Growing up biracial, with a white mother and grandparents and an absent Kenyan father, during his childhood in Hawaii and Indonesia he mastered the challenging task of negotiating his way through different cultures, getting to where he wanted to go while avoiding traps. This made him at once polite and competitive, burning to win yet reluctant to confront. Clinton, by plowing past one obstacle after another, came to think of himself as unsinkable, if not invincible. Obama, weaving around life’s potential barriers smoothly and largely alone, came to regard himself as not only lucky but destined, a sensibility that could lead to overconfidence, if not hubris.

The further contradiction in Obama is that he chose politics as his profession while harboring ambivalence about it. He has played by the conventional rules yet at times betrays a disdain for the game, whether mocking the notion of sound bites or chastising the media for being slaves to a 24-hour news cycle while he thinks in the long term. Clinton could immerse himself in the moment and excel at transactional politics. Obama is more the participant-observer, self-consciously taking note of the surreal aspects of what he is doing. Clinton’s antennae were tuned to his surroundings; Obama’s are tuned to his interior being. Clinton, a brilliantly authentic phony, could assume any role the circumstances required. Obama yearns to play roles he admires. In the first debate, he was the constitutional law professor, listening, giving ground, offering complex caveats, soberly taking notes. None of that helped him.

The Denver debate was the second ineffective performance in a row for Obama, following his convention speech in Charlotte. That moment, protected by Clinton’s incandescent oration the night before, had no discernible negative effect but, taken in tandem with the debate, intensifies the question of whether the president can talk his way out of his latest trap. His history shows that, after flailing around, he tends to respond when the pressure is greatest — and that he appreciates the role of rhetoric.

At Punahou School 34 years ago, one of his English teachers asked the class a philosophical question about what people should most fear. Classmates said death, hell, loneliness, war — and then Barry Obama straightened up and delivered his answer. “Words,” he said. “Words are the power to be feared most.”