Tim Herlihy never dreamed of writing comedy, never considered it a profession, even as he fell face-first into it, and today, isn't quite sure how comedy works. But he made Adam Sandler laugh. That's all it took. The future comedic partners met on their first days at New York University in 1984, roommates by chance. They went out for Chinese food (it was Sandler's birthday). Herlihy studied business. Sandler wanted to be the next Eddie Murphy. The two struck up a friendship. They drank beer in their penthouse dorm room (Budweiser, if they splurged). They bonded over Animal House, Bill Murray, Scooby-Doo impressions, and Rodney Dangerfield. They traded dumb jokes. When Herlihy decided to write them down, Sandler suddenly had a stand-up act. At night, they drifted from the Paper Moon in Greenwich Village ($1.50 vodka tonics after 11 p.m.) to Folk City, around the corner. Sandler hit the stage. Herlihy wrote. The laughs kept coming. Sandler blew up. After graduation, Herlihy went to law school and Sandler moved on to television, movies, and Saturday Night Live. He kept calling his college buddy for jokes. Because Herlihy wasn't going to be a lawyer. He was a comedy writer, whether he knew it or not.

Little has changed since that first day at NYU, save for over one billion dollars worth of blockbuster comedies. Herlihy became Sandler's go-to writer and producer, joining him on SNL (becoming head writer for two years after his partner's departure) and together they formed their own Hollywood comedy factory, Happy Madison Productions. But for Herlihy, understanding what made it work remains difficult. "I used to do this thing for my kids' school where I talk to third-, fourth-, and fifth-graders about comedy," he says. "I hated it. I'm just so intimidated by these kids. They ask questions and I'm spouting my theories on comedy. I don't really have any great theories on comedy." So what does he tell the kids? What does he tell himself when he sits down to write a new Adam Sandler movie? "I just do what they did in Bugs Bunny."

Is it really that simple? We asked Herlihy, who parsed 20 years of Adam Sandler movies—every screeching voice, every spurt of anger, every goofball puppy-dog face, and every oobali-doo—to help us understand one of the biggest comedy careers in modern Hollywood.

This content is imported from Third party. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

Billy Madison (1995)

Herlihy didn't know how to write a screenplay when he and Sandler were set to write one for SNL producer Lorne Michaels. In his mind, he was a lawyer masquerading as a writer. He toiled over obtained scripts for Airheads and PCU trying to learn how movies worked, matching the script style in Microsoft Word. "I heard about the first act, second act, third act thing—that was all I knew," he said. "That's still all I know." But he did it. Billy Madison looked and sounded like a movie.

Michaels hated it. "He said, 'It should all be in the same grade,'" Herlihy recalls. "We had poured our heart and soul into it." The script went back to the drawing board. A few months later, Sandler recruited Herlihy for SNL and the two sold Billy Madison to Universal. The writer remembers faxes coming in on studio letterhead. He was no longer a lawyer.

The chance to shoot Billy Madison turned Sandler and Herlihy into "dicks," in Herlihy's words. They didn't know what they were doing, but they wanted to do it their way. "All that gibberish talk, that was in the script. We thought we were doing Shakespeare." Herlihy and Sandler fought for everything. When Universal brought in a writer to rework the script, the pair reverted to their original draft on set. (Though one change stuck: "O'Doyle rules!" was the other guy's idea.) When veteran actor Darren McGavin (A Christmas Story) changed lines like "How's it going?" to "What's up?" Herlihy and Sandler insisted on the original wording. Dicks.

This content is imported from Third party. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

Happy Gilmore (1996)

Billy Madison was Universal testing Sandler's viability. Profit margins were his passing grade. So Herlihy and Sandler wrote a new movie. During the Saturday Night Live days, the pair's creative process was simply hanging out with purpose. Herlihy and Sandler would camp in an office and riff off whatever high-concept premise they could fart out. A few jokes in, the "hockey player who smacks a 400-foot drive" started sounding like a movie. Idiocy took work; if a gag made them laugh, it was in. If it didn't, Sandler killed it, driven by perfectionism. They worked on scripts until the night before shooting. By the end, there's no telling who wrote what, but they were all howling.

"SNL teaches you to be very generous with credit for stuff," he says. "To take credit for someone else's joke is a shitty, shitty thing to do. Adam is really good about that. If I say, 'That's a good idea, Adam,' then he'll say, 'Well, actually so and so gave me that joke.' It's a responsibility to be upfront about it."

There's only one joke in all of Sandler's movies that Herlihy will take credit for, and it's in Happy Gilmore. When Shooter McGavin says, "I eat pieces of shit like you for breakfast," that was Herlihy. He is sure he wrote that joke. "And Adam is equally sure that he wrote that joke," he says. But he's wrong, because Herlihy definitely wrote it. Definitely.

This content is imported from YouTube. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

The Wedding Singer (1998)

Herlihy says Sandler never felt pressured to switch gears. Progression away from the manchildren and clown voices came naturally. Herlihy knew Billy Madison and Happy Gilmore lacked female voices. They had love interests, but zero femininity. Or as Herlihy puts it: "We had boobs, basically." Drew Barrymore came to the rescue. Sandler and Herlihy's movies could finally have scenes without Sandler, an approach test audiences never approved of before Wedding Singer.

"Drew elevated things for us. The scenes with her and Christine [Taylor]—the scenes with her without Adam—[were all great]. You look at the first movies and there's not a lot without Adam because we did test screening and they said, 'Get rid of that scene.' But this time with Drew we were able to do that and have those scenes survive to the movie."

This content is imported from Third party. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

The Waterboy (1998)

The making of The Waterboy started off on the wrong foot. Sandler wanted Herlihy to go to Hawaii for a brainstorming session. This was not how they did business. "I didn't want to go to Hawaii," he says. "It was far from here. I had a family!" He went anyway. They came back with their next hit: a black-and-white, 1950s-set football movie steeped in Louisiana zydeco. It made sense at the time; Herlihy and producer Jack Giarraputo loved the Mardi Gras vibe. Sandler had Saturday Night Live's "Cajun Man" in his back pocket. They wanted to work with Jerry Reed. The end product wasn't exactly the cultural examination the original pitch imagined—though Sandler, Herlihy, and director regular, Frank Coraci, got away with choice monochrome deviations—but the film was "artful" enough to inspire a $50 million lawsuit from Harold Lloyd's estate. The silent actor's family cited similarities between Waterboy and the 1924 film The Freshman. The lawsuit claimed that Sandler and Herlihy's NYU education supplied them with knowledge of Lloyd's early comedy.

"The notion that, in our drunken haze, we would go to a Harold Lloyd movie was ridiculous," Herlihy says. The earliest comedy Sandler and he enjoyed was It's a Mad, Mad, Mad, Mad World. Until meeting Sandler at NYU, that was a movie only he and his dad enjoyed. "If you put a gun to my head, I couldn't find the repertory theaters that showed [Harold Lloyd]."

This content is imported from YouTube. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

Big Daddy (1999)

The 1999 comedy was the first movie Herlihy and Sandler rewrote from an original script. Before the duo came onboard, Chris Farley was eying Guy Gets Kid as his own star vehicle (he passed away in 1997). Sony president Amy Pascal wanted Sandler to put his stamp on it. "None of us had children when we did Big Daddy, so we didn't know what we were talking about," Herlihy notes. They still found their way into the story of a man juggling a newly adopted son. A scene in which Sandler dresses as "Scuba Steve," his kid's favorite action figure, is culled from a memory of his father doing the same thing.

This content is imported from YouTube. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

Little Nicky (2000), Mr. Deeds (2002), Bedtime Stories (2008)

Making movies is a job. A taxing one. "I've gotten lazier," Herlihy admits. If he wasn't getting paid, he may have been done after Billy Madison and Happy Gilmore. "Hopefully they won't take my pay back retroactively."

But Herlihy insists he and Sandler don't pump out movies for the paycheck. They're driven by what makes them laugh and what keeps them happy. Big Daddy, Little Nicky, Anger Management (produced by Herlihy), and Mr. Deeds were all New York movies shot in their old neighborhoods. Little Nicky, a riff on Sandler's SNL character Gil Graham, was their first movie with a sizable budget. They took full advantage, stuffing the movie with cameos and transforming a fine comedy idea ("It was like the Pacino movie The Devil's Advocate, where [the horror] was more subtle and it wasn't in hell," Herlihysays) into a bonkers one ("We threw that out and said, 'Eh, we're going to go to hell'). With Bedtime Stories, the guys wanted to make a movie for the kids they finally had. Movies are a job, but Herlihy says Sandler is always anxious to make another and novelty is a priority. "He definitely doesn't want to stop or take six months off or anything. He wants to keep making movies—so let him keep making movies."

This content is imported from YouTube. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

That's My Boy (2012)

It took 17 years for Herlihy and Sandler to produce an R-rated comedy. For the duo, the anything-goes stamp of approval felt like a sub-genre that wouldn't click with audiences. "With Billy Madison, to get a PG-13 rating, you can only say 'fuck' once. We'd have these big Talmudic debates about, if we said, 'You've got to get out there and find that fucking dog,' that was how we were going to utilize our one golden 'fuck.'" Then The Hangover happened and R-rated comedy was a $100 million business. That's My Boy, a film Herlihy produced for writer David Caspe and director Sean Anders, filled the gap. The movie tested them.

"We would look at each other occasionally like, 'Are we sure we can do this?' Like when [Leighton Meester's] banging her brother. There's a lot of controversy about that. That was in the original script. The guy, David Cassidy, wrote the fantastic script and that was in there. We were like, 'Should we do that? People are going to be just tear the cushions off the seats over this scene.' We're like, 'I guess we're going to do it.'"

This content is imported from Third party. You may be able to find the same content in another format, or you may be able to find more information, at their web site.

Grown Ups (2010), Jack and Jill (2012), and Grown Ups 2 (2013)

Herlihy and Sandler deal in the dopey, masculine, and sophomoric. What made them laugh as kids still makes them laugh now. Critics rarely join in. Herlihy remembers the first review he read of Billy Madison. The critic compared it to Auschwitz. He was shellshocked. "We thought we were writing the comedy Godfather."

As Herlihy points out, their Rotten Tomato scores remain consistently low. Conversations surrounding Grown Ups films, perhaps the duo's most "personal" films, and Jack and Jill, the one in which Sandler plays a regular Joe dealing with his dimwitted twin sister (also played by Sandler), are laced in rotten receptions and $100-plus million receipts. Their films spawn thinkpieces on gender, race, and comedic fundamentals, though Herlihy says they can't invest in those opinions. There are people who enjoy their movies, but he worries about the "ugly mob mentality" effect. "I don't care about me, I care about someone else who might feel stupid about going to see an Adam Sandler movie," he says.

Tim Herlihy in Pixels Sony Pictures

Pixels (2015) and The Ridiculous 6 (2015)

There are two sides to every "Adam Sandler movie." Sandler demands the human element, the bedrock that keeps his everyman romantic persona alive and kicking. Herlihy spins in the genre. There's a handful of movies the writer would love to make that don't fit the mold—when Farley was alive, they discussed doing a dramatic Boss Tweed movie for the star—but Sandler is the key to a greenlight. Herlihy's made do. This week's Pixels is his baby, an ode to retro gaming and slapstick action. He slaved over the script for nine months. When he handed it off, Sandler pulled a Lorne. He hated it. A day of riffing later, they had a new idea: Kevin James would play the president. Herlihy had a month to write the new version. "I was just [writing it] in bursts. I wasn't slaving over every line, it was a little more slapdash, and then everybody loved it. So that taught me to be lazy and quick."

Next is The Ridiculous Six, the first of four films Herlihy and Sandler will produce for Netflix. The Western comedy required neither laziness nor speed— Herlihy wrote the first draft back in 2006, polishing over the years. It may or not may be a good thing; when Ridiculous Six debuts this December, it'll ride through a storm of controversy surrounding its portrayal of Native Americans. Herlihy didn't see the complaints coming. "The last thing we've wanted to do with our comedy, ever, is hurt anybody," he says. "Where that line is drawn is hard to pin down, but we've always tried to stay on the right side of it." He hopes context will quell the torches and pitchforks.

Herlihy didn't know squat when he started. He's picked up a few tips along the way ("I've worked on 25 movies and I know about 25 things," he says), but there's magic to the success. Making billion-dollar movies with one of the biggest comedy stars on the planet wasn't by design. He writes jokes, prays that they're funny, then moves on to the next joke. If he didn't have Sandler, he wouldn't be doing it. It's just the truth. Which is why he's worried about his son, who plans on attending NYU film school in the near future.

"It's a tough business," Herlihy says. "Save yourself! It's not all like this. We don't all have a roommate."

There's always law school.

Matt Patches Senior Writer Patches is a Senior Writer at Esquire.com.

This content is created and maintained by a third party, and imported onto this page to help users provide their email addresses. You may be able to find more information about this and similar content at piano.io