Retired Rep. Barney Frank (D-Mass.) teaches a government class in the history of LGBT civil rights at Harvard University’s Kennedy School. (Josh Reynolds for The Washington Post)

In 1987, Barney Frank became only the second openly gay member of Congress, and the first to come out voluntarily — a milestone moment in a long career advocating for LGBT rights, financial reform and other causes. In his new memoir, “Frank,” forthcoming later this month, the retired congressman from Massachusetts explains how, as a 14-year-old boy in 1954, he had decided to keep his sexual orientation secret, realizing that homosexuality and his burgeoning interest in public service “would not mix well.”

A few years later, during a year away from his undergraduate studies at Harvard University, he read a novel that reaffirmed that conviction in very stark terms:

If I needed any further evidence that my sexual orientation and elected office were incompatible, I received it from one of the most popular political novels of the time: Allen Drury’s Advise and Consent, which I read during my year off from school. It dramatically demonstrated that the six years since 1954 had seen no change in the respective popularity ratings of government and homosexuality. The plot involved an effort by a devious FDR-like figure to press the Senate into confirming his nominee for secretary of state. One target of the administration’s pressure was a bright, conscientious young senator who was highly regarded by his elders. The senator was inclined to vote against the nominee. Then a man came forward who told the president’s people that he and the senator — by now happily married with a young daughter — had had a homosexual encounter during World War II. The man produced a photograph supporting his story. Confronting a choice between voting for a nominee he strongly distrusted and being exposed, the senator killed himself. . . . The contrast between the. . . manly ethos of public service and the shame of homosexuality was clear.

Fiction and reality were in complete accord. Following Eisenhower’s example, the Kennedy administration took its own explicit anti-gay steps. The civil service director John Macy stated that homosexuals were not welcome in federal jobs. And the administration took rapid action to avert the possibility that foreign homosexuals might be allowed into the country. . . . Since the word “homosexual” was too shocking to use when the laws were adopted, the phrase used for our exclusion was “afflicted with a psychopathic personality.” Everyone knew that meant us.

“Advise and Consent” won the Pulitzer Prize for fiction in 1960 and was adapted into a film in 1962. In his review of the book for The Washington Post, Sen. Eugene McCarthy (D-Minn.) described it as “an effective portrayal of American politics, especially as practiced in the United States Senate.”

Frank’s memoir, “Frank: A Life in Politics from the Great Society to Same-Sex Marriage,” will be published by Farrar, Straus and Giroux on March 17. Look for The Post review soon.

Read more from Book Party:

So, is there anything left to write about Lincoln?

The most self-serving words in publishing: ‘New Afterword by the Author’

George H.W. Bush’s touching, resentful and proud letter of advice to Jeb and George