Rep. Alexandria Ocasio-Cortez, D-N.Y., hit back Sunday at Aaron Sorkin after the award-winning screenwriter advised freshman Democrats to grow up.

"I really like the new crop of young people who were just elected to Congress. They now need to stop acting like young people," Sorkin said on CNN's "GPS with Fareed Zakaria." "It's time to do that. I think if there's a great opportunity here, now more than ever, for Democrats to be the nonstupid party, to point out the difference. That it's not just about transgender bathrooms. That's a Republican talking point they're trying to distract you with. That we are — that we haven't forgotten the economic anxiety of the middle class, but we're going to be smart about this."

Sorkin — who said he preferred more senior statesmen such as former Vice President Joe Biden and Sen. Kamala Harris, D-Calif., as possible 2020 presidential candidates — also suggested that Democrats abandon "20-point" programs because they don't "move people."

"You can make people understand that there's more that unites us than divides us, we have nothing to fear but fear itself. You can swat away the ridiculousness of some of the things we've been told to be scared of and paint a picture of a tomorrow that's better than yesterday," he said. "Honestly, it's good speechwriters is what you need."

Ocasio-Cortez, who last year became the youngest woman elected to Congress at the age of 29, slammed Sorkin for, among other things, perpetuating a gender bias by suggesting presidential hopefuls should have gravitas.

"We wouldn’t need to talk about bathrooms at all if we acted like adults, washed our hands + minded our own business instead of trying to clock others," Ocasio-Cortez said in a series of tweets.

[Read more: Is Dan Crenshaw the GOP's Ocasio-Cortez?]



Lastly, we wouldn’t need to talk about bathrooms at all if we acted like adults, washed our hands + minded our own business instead of trying to clock others.



Going by track record, I’d feel safer in a bathroom w/ a trans woman than a powerful male executive any day of the week. — Alexandria Ocasio-Cortez (@AOC) January 20, 2019



Sorkin, a frequent Trump critic, was the mind behind NBC political drama "The West Wing." He also won an Oscar in 2011 for the "The Social Network," a film about the founding of Facebook based on a 2009 book by author Ben Mezrich.