After a 30-year political career, Gov. Michael S. Dukakis is the same cool, untiring technocrat and unflappable optimist. But if there's any change in Dukakis as he prepares to leave office Thursday, it may be that he finally managed to lighten up a little bit.

He has made spontaneous jokes beyond the canned lines provided by speech writers. He's used humor to take on old adversaries. He's shaken hands and posed for photographs with anybody who asked. One day, he started whistling during a break in a press conference.On a recent helicopter trip across the state, Dukakis refrained from emotional reminiscing with an accompanying reporter. But among old political allies, nostalgia - and an uncommon lightheartedness - hung in the air.

Dukakis recalled, for example, a campaign trip in the early 1980s when the pants to his suit split.

"I'm walking around with my back to the wall trying to get the endorsement of the teachers," he said. "They said, `Take your coat off and stay.' "

The memories span a political career that began as a town meeting member in his hometown of Brookline, the birthplace of John F. Kennedy. Dukakis still lives there in a modest residential neighborhood.

Born to Greek immigrants Nov. 3, 1933, Dukakis went to Brookline High School, then Swarthmore College and Harvard University Law School. He was first elected to the Massachusetts House in 1962. In 1970, he lost a bid to become lieutenant governor.

He won the governor's seat in 1974, but, after raising taxes and cutting social spending, he lost the Democratic primary to Edward King in 1978. The resilient Dukakis came back in 1982, beating King in a rematch, and won a third term by a landslide in 1986.

Dukakis then became one of the so-called Seven Dwarfs seeking the Democratic nomination. He was at the height of his popularity when he left the Atlanta convention with his party's endorsement.

But his performance in the waning weeks of the campaign disappointed many, and voters went overwhelmingly for Bush.

"I gave it my best shot," Dukakis said after he lost.

Two months later, with what he had ballyhooed as the state's "miracle" economy collapsing, he announced he would not seek re-election as governor.

While the state's financial rating neared the junk-bond level and his popularity plummeted, Dukakis' wife, Kitty, drank rubbing alcohol and sought treatment for alcoholism.

Then his lieutenant governor, Evelyn Murphy, caused an uproar by threatening to implement programs of her own while Dukakis was out of the state. He postponed the trip and squelched the rebellion.

Dukakis was steadfast throughout. He kept cutting ribbons, swearing in judges and breaking ground on new projects through his final days in office.

And as he leaves office, even Ron Kaufman, a White House aide and former state Republican activist, had words of praise.

"You've got to give the governor some points," Kaufman said. "He, with all his problems now, brought a sense of honesty to government that no one ever doubted."

Dukakis counts among his major achievements in office a job training program for welfare recipients, a bill that made health care available to all state residents, and economic incentives that helped keep a boom running through much of the 1980s.

He hasn't ruled out the possibility of another run for political office, although he says that's not the first thing on his mind these days.

His immediate plans call for him to travel to Australia, then to Hawaii, where he will teach political science at the University of Hawaii.

William Schneider, the political analyst who's teaching at Boston College this year, gives Dukakis little hope of resurrecting his presidential aspirations.

"I'd say he's looked upon with contempt," Schneider said. "He's probably the most despised man in American politics along with Richard Nixon because Democrats believe, I think unfairly, that he lost the election through incompetence."

But if a Democrat wins the presidency, Dukakis may find a position, Schneider said.

Another former failed Democratic presidential hopeful, Walter Mondale, urged Dukakis to take time off and to give himself time.

Mondale noted his one-time boss, former President Jimmy Carter, has found renewed respect and popularity since leaving office.