In a perfect world, Barney Frank would have preferred not to announce that he was gay.

"The ideal would have been if I didn't have to say the words," said the Massachusetts congressman one recent day in his Longworth Building office. "For people just to know -- but that it wouldn't be a front-page story in The Boston Globe or the second story after the Celtics on the evening news. That's the societal ideal."

Ideals are not often realized, however, and it has taken Frank decades of introspection to come to terms with his own complicated reality. He has, for the most part, lived his life consistently, the politics in sync with the life style; as a dyed-in-the-wool liberal, he has always supported gay rights. Yet his private life -- though he says he's never been ashamed of it -- has been shrouded.

As Boston Mayor Kevin White's top aide from 1968 to 1971, Frank thought he'd gone as high as he could go in government. Elective office, he believed, would elude him because of his sexual preference. Then he won a seat in the Massachusetts legislature. As he kept on getting elected (he won a seat in Congress in 1980), the popular, irreverent Democrat had more and more reason to keep his personal life to himself.

A few years ago, though -- around the time his congressional seat became secure -- he started telling friends he was gay. And slowly, Barney Frank began to loosen up.

The old Barney, known for his intellectual approach to problems, was also famous for popping off in public (he once got in trouble for likening constituent services to "slopping the hogs"). The new Barney comes equipped with the same sharp mind and tart tongue. But friends say they've been seeing a softer side of him of late.

He went through a physical overhaul as well: a stunning weight loss; a stylish new haircut; well-fitting new clothes; contact lenses. This from a politician who once used the campaign slogan "Neatness Isn't Everything." (Perhaps so as not to become totally unrecognizable, Frank did continue smoking his terrible-smelling Macanudo cigars, which, he jokes, he eats instead of food.)

All this, it seems, was leading up to the moment a few weeks ago when Frank became the first member of Congress to come out of the closet of his own free will. (Frank's Massachusetts colleague Gerry Studds was censured by the House in 1983 for having had an affair with a teen-age page.)

"If you ask the direct question: 'Are you gay?' the answer is: Yes. So what?" he told The Boston Globe's John Robinson.

There were no improprieties alleged, no news stories about his sex life about to break. Just Barney Frank, face to face with his 47 years.

How does he feel now? Relieved, no question. Still, Frank says he was not anxious to come out.

"I knew they were going to ask me, so this is how I chose to deal with it," he says. "I did not volunteer it ... I had nothing that I wanted to advertise and nothing that I wanted to hide."

In part, he says, it was the journalistic climate that made him choose the straightforward option. Last year, Robert Bauman -- a gay former congressman voted out of office after being charged with solicitation of a 16-year-old -- alluded to Frank's homosexuality in his autobiography, inspiring reporters' questions that Frank ducked at the time. Then Gary Hart's quest for the presidency collapsed after press reports of his weekend with Donna Rice. And another congressman, Stewart McKinney of Connecticut, died recently of AIDS complications; the day after his death, The Washington Post reported that McKinney had had homosexual relationships.

"It touched off something," Frank says of his colleague's death. "An unfortunate debate about 'Was he or wasn't he?' 'Didn't he or did he?'

"I said to myself, I don't want that to happen to me. Now I have no reason to believe I'm not going to live until I'm 80 -- except for the fact that given my job I have to fly Eastern Air Lines a lot these days, and putting your life in Frank Lorenzo's hands a couple of times a week is not as reassuring as it once was. But I didn't want the speculation. I didn't want my family to cope with that."

He grew up in Bayonne, N.J., the son of a truck stop operator and a housewife. His parents were not well educated themselves, he says, but they put a premium on education and reading. He made his way to Harvard in 1957, took a year's leave when his father died, and graduated in 1962.

"He was intimidating in college," says his Harvard roommate Charles Halpern, dean of the City University of New York Law School at Queens College. "He was totally focused on politics even then. As a freshman he knew the names of all the U.S. senators and members of Congress and their voting records." As for his social life, friends say he dated women.

Frank never went back home, making a life and career for himself in Boston. He worked on the Mississippi Summer Project in 1964, and on various political races in 1966. He was working toward a PhD in government at Harvard in 1967 when Kevin White tapped him first to work in his mayoral campaign, then to be his executive assistant.

He was an anomaly in City Hall. "A Jew from Bayonne who delivered his stinging wisecracks in a thick 'Joisy' accent, through billows of smoke from a cigar which looked like one of Hoboken's belching smokestacks," wrote J. Anthony Lukas about Frank in "Common Ground," a prize-winning study of race relations in Boston during those years. "With his massive belly draped in perpetually wrinkled suits, Barney did not look impressive, but few people could skip so nimbly through the corridors of Massachusetts politics."

Recalls Kirk O'Donnell, president of the Center for National Policy, who also worked for White back then: "Barney essentially ran the city while Kevin White ran for governor. It was at a time when Boston was trying to reverse a long-term decline. There were racial and turf divisions, and very active students protesting the war. It was a very demanding task."

And Frank became the point man for liberal causes. So proud is he of this reputation that he refers a reporter to "Common Ground," wherein his ideology is described. ("Get the paperback," he instructs. "There's an index.") Lukas calls Frank "a doctrinaire liberal, whose message to those around him was 'Dammit, we can change things!' "

It was a time in politics when no one was open about homosexuality, and Frank says he couldn't imagine himself telling White back then that he was gay. "I didn't tell him until 1984," says Frank. "He acted surprised."

After his stint in the mayor's office, Frank returned to Harvard to try again at his thesis. "Instead I wrote an article on how I lost 100 pounds," he says (one of many crash diets over the years). The story was called "The Incredible Shrinking Barney Frank."

He says he did a number of other things that year: "I played tennis ... sharpened pencils ... drank coffee ... read the paper. Suddenly, it dawned on me that this was not my vocation in life."

Around that time, then Massachusetts Congressman Michael Harrington asked Frank to come to Washington as his top aide. "I thought at that point I would never be an elected official because I was gay," says Frank, who worked for Harrington one year.

But in 1972, the Republican state representative for the Back Bay neighborhood of Boston retired, and Frank was encouraged to run. Once in the Statehouse, he became a media darling -- which is to say he was one of the few pols there who would criticize his colleagues on the record.

He paid a price for that candor. In 1980, Frank was elected to Congress; after his first term, the Massachusetts legislature nearly redistricted him into oblivion. By combining two neighboring districts, it pitted Frank against a popular Republican incumbent, Margaret Heckler.

"One of the greatest disappointments," he says, was when "my colleagues -- who I had left the year before -- voted heavily for this redistrict ... As I think back, I was more caustic, a little angrier and not as nice to people as I should have been.

"I was more respected than liked in the Massachusetts House. I think that's connected to the pressures of having no private life. When you have no solid private life, when there is some kind of major emotional lack of balance -- what can happen is your public life carries too much weight."

Frank ultimately defeated Heckler in a harrowing, often ugly race. (Heckler tried to link him with pornography and prostitution, and in an attack aimed at Frank and another freshman congressman, Boston's Cardinal Humberto Medeiros admonished Catholics not to vote for prochoice candidates.) But the experience may have helped bring the public and private Frank together. Shortly thereafter, safely ensconced in the House seat, he began telling his closest political and college friends that he was gay.

"He's much more at peace with himself in the last five years," says Dick Morningstar, a Harvard friend whom Frank informed of his homsexuality in 1983.

"There was a change in him," says Halpern, whom Frank also told around that time. "There's less of a hard edge ... He always had a great intuitive empathy for other people's sufferings. But lately, when I discuss with him some of my own personal problems, he's very open and responsive. He has a more integrated sense of self."

In Washington, Frank became more daring in public. He attended Gay Pride Day festivities, and most of the Massachusetts delegation knew or suspected he was gay. At home, when constituents began running into him in Provincetown with other gay men, he wouldn't flinch.

And last year, when the Bauman book was about to come out, Frank did what any experienced politician would do in a crisis: He warned people.

First to receive a personal visit was then House Speaker Tip O'Neill, a Massachusetts colleague, who apparently was surprised by the news. O'Neill expressed disappointment that Frank had probably lost any chance to be speaker of the House. Then Frank told a couple of dozen other colleagues, with the idea that the word would soon get out.

Frank says he's not angry with Bauman for his reference to "the witty liberal Barney Frank {who} appears at Washington's annual Gay Pride Day in a tank top with his usual young companion," but doesn't know why Bauman chose to print it. "That's generally not considered the thing to do, especially when you're someone who has enjoyed the cover himself," says Frank. (Bauman says he believed Frank to be out of the closet when he wrote about him.)

The Bauman book prompted reporters to call and ask Frank directly if he was gay.

"I refused to answer then, probably because Bauman's book describes some fairly unhappy circumstances," Frank says, "the basic one of having sex with kids who are underage, his 4-year-old son finding the pornography, the alcoholic problem, being beaten up by people you pick up for anonymous sex, etc., etc. None of that relates to me, and I did not want to be in people's minds in that way."

He also told reporters at that time that when he did talk about his personal life, it would be with The Boston Globe. And when Hart fell because of his relationship with Donna Rice, Frank says he told friends: "Well, I guess I'm going to be out in a couple of months ..."

In the end, he gave the news story to Globe reporter John Robinson, who covers him on the Hill, and a longer interview to Kay Longcope, a feature writer for the paper.

He then called his family to let them know what was coming.

It wasn't a surprise for them, though Frank won't say when he first told his elderly mother he was gay. Friends say he had hoped not to go public while she was alive. "I did worry about the impact on my mother," he says, "because the amateur psychologists of this world tend to blame mothers."

"We are a close family," says Ann Lewis, Frank's sister and director of Americans for Democratic Action. "We had certainly talked about it." That night they all watched the news together.

Aside from his family, Frank was most concerned about his fellow House members. "If my colleagues thought that I was suddenly overwhelmed with the desire to blurt out details of my private life, they would have thought I was going crazy because I would be unnecesarily involving myself in controversy," he says.

"I was worried they might misinterpret my motives and think exhibitionism, lack of judgment ... I don't think they think that."

Privately, congressional members and staff describe Hill reaction as more "ho-hum" than shock. "It wasn't a big surprise because Barney has been dropping hints for a while," says Rep. Joe Moakley (D-Mass.), a friend. "He didn't want us to think he was hoodwinking us."

As far as the politics of the situation is concerned, Moakley says he believes Frank was "destined to congressional leadership," but that his chances are less good now. "It's never a good move politically, because there's always more minuses than pluses," Moakley says. "But if it weighed heavy on his mind and he wanted to do it, this was a perfect time -- so far out from an election year ..."

"I don't sense any trouble in the House for him," says Majority Whip Tony Coelho (D-Calif.). "He was honest."

"These are difficult issues," says Rep. Vin Weber, a conservative Republican from Minnesota. "I'm not going to make any judgment about his homosexuality, but I will say it did take a lot of courage for him to let it be known publicly."

Says one congressional aide: "There are very few districts in the country where something like this wouldn't hurt, and his is one of them. I don't expect we'll be seeing a big rush of other gay members clamoring to come out of the closet."

For the most part, Frank believes, nothing will change in his life. He is immensely popular in his district, having won reelection in 1986 with 90 percent of the vote.

"I don't think I'm going to lose my seat over this," he says.

He is sensitive to possible constituent fears about him -- that he might turn into a one-note congressman, for example, loudly crusading for gay rights. If gay groups expect that from him now, he says, "I think they'll be disappointed."

He points out, however, that he has always been a supporter of gay rights -- "one of the first people in the Massachusetts state legislature to sign a gay rights bill." Frank also authored a revision of the McCarran-Walter act that called for the elimination of homosexuality (among other factors) as grounds for preventing foreigners from entering the country.

Frank won't talk about the specifics of his private life. He concedes he's worried about AIDS, but won't say whether he's been tested. "That gets into personal medical stuff," he says. "I'll say this: I think if you were to take a poll you would find the level of information on how AIDS is transmitted higher in the gay community than anywhere else in society. Gay men are more inclined than most people to act in ways that do not transmit it."

As for limits on his political future, he resists self-pity or speculation about what might have been. He plays like a man who accepts the cards dealt him. And he refuses to traffic in psychic distress.

"Let me say that I have retreated a little bit, but I still have my defense lines up. I will acknowledge that I am gay and I will tell the public that fact. I'm not into sharing angst. There are these politicians who talk about 'Oh, the burdens!'

"I admire Mario Cuomo the public man very much, but he kvetches too much," Frank says. "It's the Yiddish word for complain and whine and bitch. I don't want to kvetch in public. How I felt, the inner pressures -- it's nobody's business.

"Who wants to know that? Do they want to be eating breakfast worrying about the inner emotional turmoil of a middle-aged politician? Let them tape 'Dynasty' instead."