Half of the showrunners of the programs in the list below are women. Women are 51% of the population of this country.

This is not boring math. What’s finally occurring in TV is a long-overdue revolution.

A decade ago, I would have been hard-pressed to find a single female showrunner within shouting distance of my end-of-year best-of list. Not because there weren’t women who had stories to tell and the skills to bring them to life. There have always been plenty of those women around. But the precincts of ambitious, adventurous TV — and all too often, huge sections of regular, meat-and-potatoes TV — were pretty much a dude-fest. (It’s still usually this way in TV; look at the stats.)

But as I perused my very long list of possible Best TV contenders, it was heartening to see that women were not only making a lot of incredible, funny, gripping, provocative programs, but also that female characters predominated in so many of the shows.

More than a dozen programs on my Top 20 roster are about groups of women, and these programs frequently depicted how women relate to each other, to the world and to the men in their lives. For decades — with a few exceptions, of course — it often felt like nobody who had real power in TV cared all that much about female friendship (and enemy-ship, and mentorship, etc.). Again, it’s a systemic thing, because most creators and showrunners are men, who are of course capable of making good and great TV, but a sizable percentage aren’t all that interested in relationships among realistically complicated women. As much as I loved “Mad Men,” “Deadwood,” “Breaking Bad” and shows like it, they rarely depicted bonds among women with any kind of sustained depth or dazzling complexity.

But look at the year’s most buzzworthy, acclaimed TV shows: Many of them, from “Big Little Lies” to “Handmaid’s Tale” to “Insecure” to “Crazy Ex-Girlfriend” were fantastically curious about the interior and exterior lives of women. Solitary women and groups of women. Women driven by an enormous array of motivations, dreams and ambitions. There were any number of ways in which these varied programs depicted women’s friendships, commitments and challenges, and the compromises women — especially women of color and queer women — have to make in order to fit into the narrow categories society has prepared for them.

The evolutions didn’t stop there. One of the neatest spectacles of the last few years was watching “The Leftovers’” and “Halt and Catch Fire’s” showrunners — white guys! — realize that the most interesting arcs on their shows belonged to the women who had been more or less on the sidelines at first. The sagas wanted to go there, and the storytellers followed.

We’re not in the promised land, of course. The parade of sludgy, derivative prestige imitators continues, and when it comes to that kind of fare, allow me one mini-rant: I remain generally unimpressed by TV episodes that run more than about 50 minutes. (If I had a nickel for every 2017 episode that dragged on for more than an hour and actually justified that running time, I would have… three nickels. Five at the most.)

A much more important gripe: Only a few shows below were created or run by people of color, and only one is run by a LGBT creator. We need more voices, more stories, more perspectives, more of the fresh and vital excitement that comes from examining points of view that are typically ignored, minimized or depicted in stereotypical ways.

There’s still much work to be done. As we now know, with brutal accuracy and heartbreaking specificity, much of Hollywood gives free reign to powerful men who abuse without consequence, and many reforms need to be made before most or all employees in the industry will routinely feel physically and psychologically safe from assault, harassment and bias. As hard as it is, we need to keep thinking about what it cost for these women and men to come forward and tell their stories, and what actions will help in a sustained, meaningful manner. We can either get to the root of the interlocking problems arising from the rampant abuse of power, and we can make sure that promising creative people are not driven out by predators, toxic bullies and harassers. Or we can give in to the way things have always been. That’s simply not an option.

The best programs contain small but sturdy beacons of hope in their DNA. In a year that was often demoralizing, and in which stories of predation, exclusion and oppression dominated the news — in a year in which Americans often felt ground down even on the non-terrifying days — these shows found joy in heartbreak, and vice versa. As I looked at my final list, it felt good to realize that, all year long and well before that, a hardy band of men and women with bold ideas and big hearts were in writers’ rooms, on sets and in the world, doing their best to fight an enormous tide of cruelty, rage and stupidity. We got a Tasmanian sex boat, the Trolley Problem (twice!), a musical about Juneteenth and the best quinceañera ever. If there is a culture war raging, it is being fought with solid jokes, with specific and memorable characters, with spectacular visions, with daring ideas executed with care and precision, with minds and passions and inspirations.

These shows gave me food for thought and sustenance for the soul in a tough time, and there were belly laughs too. I’m grateful for all of it.

A couple of housekeeping notes: If something you really liked isn’t on my main list or in my rosters of Honorable Mentions, you can assume I didn’t get to it (there’s too much TV!). Or you can assume I did not like it as much as you did. Go with whichever assumption prevents you from “but what about”-ing me on Twitter. Also, I have not finished “Twin Peaks,” but what I’ve seen so far was suitably destabilizing. (And, per a recent online debate, “Twin Peaks” is not a movie. It is a TV show. Long live television.)

20. “Mary Kills People,” Lifetime

You may not have heard of this show, which is one reason I included it. It’s on Hulu now, and it’s a smart, empathic take on end-of-life choices, and it’s a pretty nifty mystery story too. Caroline Dhavernas anchors this brisk and surprisingly entertaining — if occasionally dark — story with charisma, skill and a very deft touch. My review of “Mary Kills People.”

19. “One Mississippi,” Amazon

As those of us who cover pop culture struggled with the outpouring of stories about sexual harassment, assault and predatory behavior, many rightly pointed to “One Mississippi’s” sensitive portrayal of the ways in which its characters grappled with both childhood sexual abuse and an arrogant harasser in the workplace. The latter storyline, which had clear echoes of the facts that have come to light about executive producer Louis C.K.’s behavior, was extraordinarily well done. But “One Mississippi” is a quiet show that contains multitudes: It continued to be an honest but loving portrayal of the political and social fault lines one particular town, and a portrait of the limits and comforts of family loyalty. I love John Rothman’s Bill so very much, and watching Bill and Tig Notaro’s lead character find love after a profound loss was just lovely. My review of the second season of “One Mississippi.”

18. “Wynonna Earp,” Syfy

An ad-hoc family fighting demons? Check. Witty, rapier-sharp dialogue? Check. Fierce and committed performances, especially from a multi-talented leading lady? Check. All those elements were quite rewarding, but “Wynonna Earp,” the best comedic horror-Western on the TV prairie, also fit in meditations on motherhood, duty, friendship, romance and community. Every week, “Wynonna Earp” is quippy, big-hearted, highly enjoyable fun, and I can ask no more of a TV show. My review of the second season of “Wynonna Earp.”

17. “Black-ish,” ABC

Another year, another array of “Black-ish” installments taking on important issues, but doing it in ways that were both acerbic and thoughtful. This show deserves to be on the list for “Juneteenth” alone, but “Lemons,” “Mother Nature” and “Sprinkles,” among other episodes, were also outstanding. A story on the election episode of “Black-ish,” and another on the origins of “Mother Nature.”

16. “Top of the Lake: China Girl,” SundanceTV

Elisabeth Moss’ 2017 one-two punch has few TV equals in recent memory. Her character in “Top of the Lake” was less collected and focused than Offred, but Moss once again depicted the complicated depths of a woman’s anger, pain and professional dedication. Creator Jane Campion and Moss were perfectly in sync, just as they were in the first season, and despite one supporting character who didn’t really work, the ensemble as a whole, and the show’s meditations on sexuality, motherhood and exploitation, made each installment raw, deep and mesmerizing. My review of “Top of the Lake: China Girl.”

15. “Big Little Lies,” HBO

This miniseries expertly combined elements of a high-gloss soap opera with a series of laser-sharp character studies. What else can be said about the sensational cast, aside from the fact that they and director Jean-Marc Vallée made this drama addictive in all the best ways. (I mean, the real-estate envy alone!)

14. “Insecure,” HBO

Growing more confident in its second season, this insightful and hilarious show delivered the goods, week after week. Dating, race, career goals, ambition, class and friendship — “Insecure” depicted all these topics and the ways in which they can awkwardly collide with a skilled, lively approach. Issa and Molly have one the best, most realistic friendships on TV, and seeing the development of the supporting cast was highly enjoyable as well. My review of Season Two of “Insecure.”

13. “The Handmaid’s Tale,” Hulu

There were times this show meandered a little more than I would have liked. But that is a relatively minor issue, and the pleasures of watching Elisabeth Moss, Ann Dowd and this intensely dedicated cast give their all to the material made the drama frequently gripping. We may not be living in Gilead, but few shows captured the dislocating, surreal landscape of 2017 with more psychological accuracy than “The Handmaid’s Tale.” My interview with Bruce Miller, executive producer/showrunner of “The Handmaid’s Tale.”

12. “Superstore,” NBC

This reliably funny show has continued to build on the strengths of its cast, and it’s kept on addressing hot-button issues, but not in dumb or exploitative ways. This is character-driven comedy at its best, set among an extremely varied group of people who live in fear of downward mobility. In other words, “Superstore” is not just reliably fun to watch, it might be the most timely and relevant network comedy on the air.

11. “Into the Badlands,” AMC

This is a post-apocalyptic story that doesn’t ignore the challenges its characters face, but it also doesn’t sink into dull gloom or repetitive storytelling ruts. It’s a lot of engaging, badass fun, and it has proven to be an excellent showcase for its game cast. If that isn’t enough, it’s easily one of the most gorgeously filmed shows on television, and it has the best martial arts and action anywhere on the small screen. Five reasons why “Into the Badlands” is awesome.

10. “Brooklyn Nine-Nine,” Fox

Few comedies were as consistently amusing and funny as this cop show was this year. The sharp and versatile ensemble continued to gel and to prove that they’re one of the most engaging casts on TV, and the writers were more than up to the task of giving this excellent group very good material. It’s a delight.

9. “American Vandal,” Netflix

Perhaps because I watched them the same week, “American Vandal” and “Alias Grace” reminded me of each other: Both were about the excavation of memory and the secrets and lies that exist under the surface of seemingly ordinary lives. “American Vandal” was, on one level, about who drew a series of dicks on some cars in a school parking lot, and as a satire of earnest true-crime documentaries, it was hilariously spot-on. But it evolved into one of the best high-school TV stories in recent memory, and a gently honest and thorough one at that. Though I was gripped by the question of #WhoDrewTheDicks, I was, in the end, even more captivated by the fact that this show worked so subtly and so well on an impressive number of levels. “American Vandal” was about a lot of things, but often, it was a wry, honest meditation on the stories we tell each other about who we are, and how even the most well-intentioned members of the media can be just as fallible as those they cover.

8. “Alias Grace,” Netflix

Everyone loves a good crime whodunit, and this adaptation of Margaret Atwood’s fascinating tale was top-flight in every respect. It was set more than 150 years ago, but the drama’s explorations of female autonomy and oppression were about as topical as they could be. Sarah Gadon was a stunning revelation in the lead role, and the creative team of Sarah Polley and Mary Harron turned this mystery tale into something gripping, prickly and lyrical all at once.

7. “Better Things,” FX

The second season of this half-hour delivered a unique combination of contemplative ambiguity and brash honesty, and its clarity, wit and deeply felt emotions will stay with me for a long time. “Better Things” is an empathic, realistic look at what it’s like to be a mother, a woman, a working professional and a person who doesn’t have all the answers, but who tries, when she can, to fully experience life’s possibilities and live in the moment. I have thought for weeks about what to say here about Louis C.K.’s involvement with this show. I have so many things to say, yet I have nothing to say, because, when it comes to this topic, I remain mentally mired in circular thought patterns. I have many questions and no real answers. Two things I do know: I watched the first seven episodes of the second season in August, and I was intensely moved by what I saw then (and during the rest of the season), and what Pamela Adlon accomplished as the sole director of a show based on her life is truly impressive. That’s not an answer to all the questions I have, but that’s what I have right now. My review of the second season.

6. “Jane the Virgin,” CW

One of TV’s finest and most ambitious offerings took on grief, pulled off a time jump and introduced new characters, but “JTV” never lost sight of its many strengths. I hoard episodes of this show and break them out at low points, when I really need to visit and be comforted by the world the Villanueva women live in. Week after week, “Jane the Virgin” makes me laugh and cry, and provides comfort, smart meta-narratives and clear-eyed character journeys with effortless grace. An emotionally acute and innately intelligent show that remains must-see viewing.

5. “Crazy Ex-Girlfriend,” CW

It’s a fantastic ensemble piece about mental illness — with singing and dancing! One of TV’s most audacious shows is also one of its funniest and most smartly put-together. “CEG” sharply skewers rom-com tropes and TV cliches even as it provides an honest, fascinating look at a woman who’s unable to be truthful about the foundations of her pain and self-sabotage. From the day it began, “CEG” has continually upped its game, and in Season Three, the writers, songsmiths and ensemble cast brought the comedy to a whole new level of awesome. “Crazy Ex-Girlfriend” is a treasure.

4. “Halt and Catch Fire,” AMC

On the surface, this was a story about breakthroughs in technology, but it was really about the evolution of business ventures and personal relationships among a group of compelling core characters. Actually, at its heart, it was a show that loved delving into the creative partnership of two very different women, who clashed and diverged and fought and came back together again, because they believed in each other’s creativity and drive so very much. This highly enjoyable and moving drama, which boasted a first-class cast capable of many wonders, upgraded every season until it was absolutely perfect in its final year. My piece on the series finale.

3. “The Good Place,” NBC

This brilliant, audacious exploration of heaven, hell, morality and ethics is blessed with an exceptional cast, who work wonders with the writers’ witty, insightful work. “The Good Place” is smart, compassionate and about something — but it’s also really goofy and fun. This sitcom is fizzy, earnest combination of things that shouldn’t work together, but somehow do. Fab. Some thoughts on the show’s progress almost a year ago.

2. “One Day at a Time,” Netflix

Never let it be said that the multi-cam sitcom is a thing of the past, or that reboots are usually bad. This return to the Norman Lear library proved both generalities wrong. This delightful show allowed Justina Machado to show off her exceptional dramatic and comedic ranges, Rita Moreno proved once again that she is a national treasure, and the rest of the cast rose to these women’s exceptional levels. It’s one of the best-written, smartest and most-warmhearted shows around, and I’m so glad it exists.

1. “The Leftovers,” HBO

How is it that a show about grief, loss, pain and dislocation ended up being such an absolute joy? It’s a mystery — which is apt, given that “The Leftovers” is about how ambivalence and confusing questions can lead to both deep sorrow and the possibility of profound connection. This show didn’t just connect with me, it changed my life and possibly my DNA. This was an all-time great, Hall of Fame season of television. My review of the series finale is here, and a personal essay about the intersection of “The Leftovers” and my life is here.

Honorable Mentions

Returning shows: “The Americans,” “Better Call Saul,” “The Carmichael Show,” “Catastrophe,” “Dark Matter,” “Fresh Off the Boat,” “Full Frontal with Samantha Bee,” “Game of Thrones,” “Girls,” “iZombie,” “Killjoys,” “Last Week Tonight with John Oliver,” “Master of None,” “Mr. Robot,” “Outlander,” “People of Earth,” “Review,” “Silicon Valley,” “Speechless,” “Stranger Things,” “Survivor’s Remorse,” “Twin Peaks,” “The Unbreakable Kimmy Schmidt,” “Underground,” “You’re the Worst.”

New shows: “American Gods,” “The Bold Type,” “Crashing,” “Dear White People,” “The Deuce,” “GLOW,” “I Love Dick,” “The Keepers,” “The Last Tycoon,” “Legion,” “The Marvelous Mrs. Maisel,” “National Treasure,” “Shots Fired,” “13 Reasons Why,” “To Walk Invisible,” “Witness for the Prosecution,” “The Young Pope.”

Be sure to check out my fellow TV critic Sonia Saraiya’s end-of-year list, as well as all of Variety’s 2017 Best and Worst lists.