If you were born after 1970, I think it is nearly impossible to imagine how it felt to open up The New York Times Magazine on a Sunday morning in January 1971 to discover “What it Means to be a Homosexual,” a deeply personal and beautifully written piece in defense of homosexuality.

Nothing like this had ever been printed in a newspaper like the Times before. I was a junior at Columbia University in the City of New York when the novelist and journalist Merle Miller’s piece appeared, and I had undoubtedly purchased the Sunday Times at a newsstand on Saturday night. But I’m sure I didn’t share my fascination with his article with any of my classmates on Sunday morning.

I had been aware of my attraction to other boys throughout my teens, and even earlier, but I always assumed that I was going through “a stage”—because that is what you were taught to believe back then, to spare yourself the possibility that you might be afflicted by something that would condemn you to “permanent niggerdom among men,” as Joseph Epstein so delicately put it in Harper’s, shortly before Miller wrote his rejoinder to Epstein’s piece.

Six months before Miller’s article appeared, raging teenage hormones had finally merged with opportunity to produce my first adult homosexual experience. It happened in Avignon, when I was driving Lionel and Diana Trilling around the South of France. (As proper New York City intellectuals, neither of them had ever had a driver’s license.) One night after the great critic and his wife had retired after dinner, I drove to the Avignon town square, where hundreds of young people were swirling around dozens of musicians, actors, and every sort of impromptu performance.

I knew exactly why I was there, and quite quickly, I spied a young Frenchman who seemed eager to cure my curiosity. But since I had never done anything like this before, it took forty-five minutes of hide-and-seek with the young man until we finally said “bonsoir.” Then I immediately agreed to drive both of us back to his apartment. On the way, I learned that he owned a record store with his lover, who was away on vacation in Morocco.

My first grown-up gay experience was a tremendous stroke of luck: he was young and cute and passionate and affectionate, and when we sat down next to each other on the couch in his apartment, the first thing he did was to rest his head on my lap. I stayed with him for at least two hours; and long after I had worn him out, I still wasn’t ready to leave.

It had been the most exciting and fulfilling two hours of my life. And yet, when I finally walked out the door, my first thought was, “Well, I’ve gotten that out of my system. Now I can go back to girls!”

A couple of weeks later, when I was back in London, where I was spending the rest of the summer, I picked up a ghastly man in the park and had an utterly disgusting experience. That led to nine months of celibacy. It was during this fallow period that Miller’s piece appeared, and it was a godsend. Though by now I may have considered myself bisexual, I was still quite undecided about which side of the great sexual divide I would end up on.

Like anyone in my position in 1971, I knew what would happen if I ever declared myself publicly as a homosexual. As Miller wrote in the afterword to his article, closeted doctors and therapists had told him that coming out would mean losing their patients; “lawyers wrote that they would lose their practices; writers would lose their readers; a producer would not be able to raise the money for his next musical if . . .”

I had grown up in the fifties and the sixties, when practically the only public homosexuals in America were James Baldwin, Allen Ginsberg, Gore Vidal, and (the bisexual) Paul Goodman. There were no gay images on television (unless you count Paul Lynde and Liberace), no politicians in favor of gay rights (much less any who were out of the closet themselves), and no news coverage that didn’t share the tone of a notorious page-one story in The New York Times that appeared in 1963. It carried this headline:

Growth of Overt Homosexuality in City Provokes Wide Concern

That article reported that “the presence [in Manhattan] of what is probably the greatest homosexual population in the world and its increasing openness . . . has become the subject of growing concern of psychiatrists, religious leaders, and police.” The story—appearing in a bastion of American liberalism— declared that “the old idea, assiduously propagated by homosexuals, that homosexuality is an inborn, incurable disease, has been exploded by modern psychiatry, in the opinion of many experts. It can be both prevented and cured, these experts say.”

That piece of conventional wisdom was integral to the nearly universal prejudice against gay people—the idea that the only healthy gay person was one who was desperately trying to become straight. Joseph Epstein was merely the first person to give voice to that prejudice after the 1969 Stonewall riots—with a crudeness and a vehemence that are startling forty years later. It should be remembered that his piece was published in Harper’s when the magazine was edited by Willie Morris, a Southern hero to liberal writers everywhere—including Miller. Miller was hardly alone in thinking Harper’s was “one of the best, maybe the best, magazine in the country.”

The year 1970 marked the first time that three candidates running for a United States Senate seat from New York had all endorsed proposals for constitutional rights for gay people, as well as the repeal of the antisodomy law that made gay lovemaking a crime. And yet, as late as 1978, Jeff Greenfield—a former speechwriter for Robert Kennedy—wrote a cri de coeur in Manhattan’s very liberal Village Voice entitled “Why Is Gay Rights Different from All Other Rights?” Greenfield argued fiercely against a bill before the New York City Council that would ban job discrimination based on sexual orientation—one that, because of the fervent opposition of the Catholic Church, would not get passed until 1986. Greenfield wrote, “It is not a denial of a fundamental right to be refused promotion because of your companions,” and he called the fight for an antibias law for gays “a diversion from the business of working for political and social justice.” That, of course, was the opposite of the truth.

Miller had identified the reason why antigay prejudice would persist for so long among certain liberals:

[H]omosexuals, unlike the blacks, will not benefit from any guilt feelings on the part of liberals. So far as I can make out, there simply aren’t any such feelings. On the contrary, most people of every political persuasion seem to be too uncertain of their own sexual identification to be anything but defensive. Fearful. And maybe it is contagious. Prove it isn’t.

Certainly no one seemed more fearful of homosexuality than Joseph Epstein. At the end of his article, he wrote, “I find myself completely incapable of coming to terms with it.” He was appalled by “the brutally simple fact that two men make love to each other.” And he concluded by saying that nothing his sons “could ever do would make me sadder than if any of them were to become homosexual.” Though Epstein didn’t say it, the implication many drew was that even a homicidal son would make him less unhappy than a gay one.

Epstein was a classic example of what therapist George Weinberg identified as “the homosexual problem” in Society and the Healthy Homosexual, the groundbreaking book he published in 1972. Weinberg wrote that it was the “problem of condemning variety in human existence.” What was extraordinary was how quickly the psychiatric profession would come around to Weinberg’s enlightened point of view—less than two years after his book was published. This was much more quickly than Miller and almost everyone else had imagined was possible.

On December 15, 1973, the board of the American Psychiatric Association (APA) announced that it had voted thirteen to zero to remove homosexuality from its list of psychiatric disorders. The declaration was front-page news in The New York Times and in newspapers all across the country. Even to many gay activists, this was startling. Until the mid-1960s, most of them had automatically assumed that homosexuality was a mental illness.

I was twenty-three when the APA announced that decision. Four decades later I still remember it as a moment of supreme empowerment. Perhaps as much as anything else, it was this action by the APA that enabled my generation—and all the generations that have followed—to have a positive self-image that was so different from the one most gay men had before the 1970s. For some, the transformation had arrived even earlier—as soon as the Stonewall riots occurred in June 1969.

“Gay power!” Allen Ginsberg exclaimed the day after the riots. Inside the Stonewall Inn, he discovered, “the guys there were so beautiful—they’ve lost that wounded look that fags all had ten years ago.” Miller had noticed the same thing in the younger generation by 1971: “I’m not sure it’s a full-scale revolution yet,” he wrote, “but there’s been a revolt, and for thousands of young homosexuals, and some not so young, the quiet desperation . . . is all over. They are neither quiet nor desperate.”

The joyfulness and the sense of wild abandon that so many of us in the first generation of liberated gay men had embraced came to a crashing halt in July 1981, when a story in The New York Times announced the arrival of a strange and unusually virulent new disease—not yet identified—whose victims were mostly young gay men. For more than a decade—before drugs were discovered that would eventually make it a manageable disease for most of its American victims—we lived in a terrifying time. The AIDS epidemic would decimate my generation, killing off many of its most creative members before they were forty. My educated guess is that half of us died in New York and Los Angeles, and perhaps an even larger proportion in San Francisco. The situation was made even worse by President Ronald Reagan, who took office the same year the epidemic was discovered— but never even said the word AIDS until the seventh year of his presidency.

And yet, despite the trauma, this ghastly disease would also have many positive effects. Most professionals (including myself) still hadn’t come out of the closet by the end of the 1970s, because of a continuing fear about how such a declaration would affect us at the office. I worked at The New York Times throughout the seventies. Back then, its top editor was famously homophobic. A. M. Rosenthal, who was managing editor and later executive editor of the paper, once declined to make Walter Clemons a daily book critic, after his colleague, Christopher Lehmann-Haupt, told Rosenthal that Clemons was gay. And the word gay was only allowed to appear in the paper inside quotation marks during Rosenthal’s regime. (Miller’s piece was published after Rosenthal had become managing editor, but before the Sunday magazine fell under Rosenthal’s control, a change that occurred when the daily and Sunday news departments were unified in 1976.)

The year before the AIDS epidemic was discovered, there still wasn’t a single openly gay reporter or editor in the newsroom. Only after AIDS would it become obvious to everyone that there were gay people in every profession and every walk of life—from the actor Rock Hudson to the notorious redbaiter Roy Cohn.

At the height of the epidemic, The New York Times underwent a dramatic change in its attitude toward its gay employees, and gay subjects. This occurred when Max Frankel succeeded A. M. Rosenthal as executive editor in 1986. Almost immediately, Frankel made it clear to all of his gay colleagues that “whether they wanted to be openly gay, or whether they wanted to be relaxed, but not very openly gay, or whether they wanted to be secretly gay or lesbian, was their business, essentially, and not mine.” He also rapidly expanded the paper’s coverage of gay subjects.

The changes were cemented in 1992 when Arthur Sulzberger was succeeded as publisher by his son, Arthur Sulzberger Jr. The younger Sulzberger was a child of the sixties who had made it clear to everyone that he would not tolerate an iota of prejudice toward any gay reporter or editor. A decade later the new publisher approved a change in the “Wedding” pages to “Weddings and Celebrations,” so that the Times could become one of the first newspapers to celebrate gay unions—nine years before gay marriage became legal in New York State.

As I write these words, news of the decision by a three-judge panel of the federal court of appeals in San Francisco is coming across the Internet. The majority had declared that Proposition 8, which banned same-sex marriages in California, is unconstitutional, because it serves no purpose other than to “lessen the status and human dignity” of gays. This was the third great victory for the gay movement to come out of the federal courts. The first one was Romer v. Evans, in 1996, when the Supreme Court invalidated an amendment to the Colorado state constitution that would have forbidden protection for gay people from discrimination.

The second and most important one was Lawrence v. Texas. Announced at the very end of the court’s term on June 26, 2003, it was the decision that every gay activist had been waiting for since the movement began. It invalidated every sodomy law in the land, the statutes that had made our way of lovemaking a crime since the republic began. Linda Greenhouse, the great Supreme Court reporter for The New York Times, pinpointed the decision’s significance: “A conservative Supreme Court has now identified the gay-rights cause as a basic civil rights issue.”

I don’t know whether the current Supreme Court will confirm the California ruling in favor of marriage equality, or whether we will have to wait another twenty years before the very basic right to marry is extended to gays and lesbians throughout the land. But I do know this: the last forty years have been the greatest time to be gay since the era of Aristotle.

Adapted from Charles Kaiser’s afterword to On Being Different: What It Means to Be a Homosexual by Merle Miller, published by Penguin Books on September 25, 2012. Afterword copyright © Charles Kaiser, 2012.