In “Jokes and Their Relation to the Unconscious” (1905), Sigmund Freud observes that a strict superego — or the conscience that punishes misbehavior — results in a correspondingly aggressive jest. As we all have found, whether at school or in the workplace, the harshest superego suppresses laughs entirely. In practical comedic terms, jokes get meaner and meaner until they stop being funny altogether. As the new Woody Allen film “Whatever Works,” starring Larry David, opens, and the promotional campaign begins for Sacha Baron Cohen’s forthcoming “Bruno,” scheduled for release July 10, these concepts are timelier than ever. Tender soulfulness has never characterized Jewish comedians — think of Don Rickles — but has the harshness developed to the point of drowning out the merriment?

For decades, Allen, now 73, has presented himself as a dismal icon of despair, and in a recent interview he tells a fawning Argentine journalist that “life is suffering,” whining with characteristic joylessness that his wildly overpraised 2008 film, “Vicky Cristina Barcelona,” was not intended as a comedy, even if viewers and critics took it as such. For decades, audiences have applauded this culture of complaint. Even Allen’s reported “true love” of jazz clarinet is expressed publicly in desultory sour-toned performances in a Dixieland jazz band cheered on by star-struck punters at concerts worldwide. Self-deprecating humor turns to self-deprecation, and then just general deprecation.

Last year, Allen sued Dov Charney’s clothing company, American Apparel, for using his likeness on billboards without his consent, in a case that was settled May 18. Allen accused American Apparel of engaging in a “despicable effort to intimidate” him by claiming that by marrying Soon-Yi Previn, the adopted daughter of his ex-wife Mia Farrow, Allen damaged his own potential for endorsements. Of course, no one disputes that Allen did marry his ex-wife’s adopted daughter, but bringing up the matter in the context of this lawsuit ticked off the comedian considerably. Charney, a Montreal-born Jew, has been involved in some controversies of his own, yet Allen revealed a fatal lack of self-awareness in not merely complaining about the unauthorized use of his image, dressed as a Hasidic rabbi in “Annie Hall,” but also calling American Apparel advertisements “sleazy,” “adolescent” and “infantile.” Allen’s own vulnerability to similar criticisms following the Previn scandal seems to have slipped his mind entirely.

But then, Allen is a famous failure in psychoanalysis, which he finally dropped after 30 years of therapy, around the very time he began his relationship with Previn. John Baxter’s “Woody Allen: A Biography” (Da Capo Press, 1999) points out that “like Catholic confession, Allen’s form of analysis let the penitent go free to sin again.” No one doubts Allen’s continued abilities to crank out gags like the classic “I don’t believe in an afterlife, although I am bringing a change of underwear.” Yet none of the japes seems to have improved his mood.

Indeed, Allen’s films, as critics and even some fans have observed, have increasingly become black holes of futile despair, “sour, dispirited, almost vindictive” as Terrence Rafferty wrote in a still-pertinent review of “Husbands and Wives” (1992). Some of the gags still work, despite the overall dispiriting nature of the films that contain them. Such male stars as John Cusack, Kenneth Branagh and Michael Caine are puppetlike stand-ins, straining to imitate Allen’s own herky-jerky speech, uncontrolled gestures and other personal quirks as they read the lines written by him. The same physical mannerisms that made Allen a successful stand-up comedian make him an awkward, amateurish actor, and most of the actors for whom he writes — with the exception of rare majestic talents like Martin Landau and Jerry Orbach in “Crimes and Misdemeanors” — make the capital error of now trying to mimic him. David, as a misanthropic physicist who makes repeated suicide attempts in “Whatever Works,” scheduled for general release from Sony Pictures Classics on June 19, will doubtless avoid this mimicry, since he carries around his own baggage of eccentricity.

In “Seinfeld” and “Curb Your Enthusiasm,” David, a native of the Sheepshead Bay area of Brooklyn, specializes in finding comedy in the trivialities of life, with a ferocity that puts off critic Lee Siegel in The New Republic, who terms David’s choleric fits “merely the anger of frustrated entitlement. [He] has perfected Seinfeld’s superior, uninviting stare into a cold, cruel sneer.” Even HBO’s “Curb” Web site, amid paeans of praise, offers an occasional dissent: “A bunch of screaming Jews apparently ad-libbing; it is not funny.” When standup comedian Susie Essman shrieks profane insults at David’s character in “Curb,” she and other actors provide the superego, the out-of-control conscience that punishes his misbehavior. David’s comedy derives from situations, such as when he invites a sex offender to a Seder, rather than from Allen’s carefully honed and polished jokes. Yet the output of both Allen and David can be seen as sharing a basic acerbic negativity.

David’s friend and colleague Larry Charles, himself a Brooklyn Jew who produces “Curb Your Enthusiasm,” told The New Yorker that David’s Brooklyn upbringing gave him a “‘Lord of the Flies’ sensibility” in a “very savage environment, in a lot of ways, a very cruel and sadistic environment.” Such cannot be said of Baron Cohen, who grew up in leafy Hampstead Garden Suburb, graduating from Cambridge University complete with a prize-winning thesis on civil rights before filming his comedy hit “Borat” and the upcoming “Bruno.” Both of these movies are directed by Charles.

By focusing on prank interviews with real-life people who are shown to be naive, credulous or otherwise objectionable, Baron Cohen has offended some viewers and amused others. As Borat Sagdiyev, the faux-Kazakh journalist, Baron Cohen sang a pseudo-folksong: “Throw the Jew down the well/So my country can be free/You must grab him by his horns/Then we have a big party.” The song, praised by Slate as “hilarious” and “catchy,” raised concerns from the Anti-Defamation League last September: “One serious pitfall is that the audience may not always be sophisticated enough to get the joke, and that some may even find it reinforcing their bigotry.” Certainly, Baron Cohen’s timing was flawed; in 2007, in Kazakhstan’s neighbor Uzbekistan, the noted Jewish-Uzbek stage director Mark Weil, 55, was stabbed to death in what local police termed “an antisemitic attack.” The joke sours when Jews are in effect still being thrown down the well near Borat’s homeland, and elsewhere.

Baron Cohen’s latest movie character, Bruno, a gay Austrian fashionista, has similarly made fun of the Holocaust, Hitler and other related subjects. In an earlier incarnation of HBO’s “Da Ali G Show,” Bruno opined that the singer Ricky Martin should be kept “in the ghetto,” while the actor Burt Reynolds should be “condemned” to a “train to Auschwitz.” In the forthcoming film, Bruno will confront a former Mossad agent, homophobes and Republican politician Ron Paul, among others.

Citing historian Ian Kershaw’s formulation that the “path to Auschwitz was paved with indifference,” Baron Cohen told Rolling Stone magazine in 2006: “I know it’s not very funny being a comedian talking about the Holocaust, but it’s an interesting idea that not everyone in Germany had to be a raving antisemite. They just had to be apathetic.” Borat’s antisemitism, Baron Cohen added, “lets people lower their guard and expose their own prejudice.”

Prodding people into showing their worst sides may be a valid experiment in social psychology. Baron Cohen himself likens it to Stanley Milgram’s series of experiments, but some critics have even compared Baron Cohen’s getting his interview subjects to agree to false or evil statements to research on social pressure by the Gestalt psychologist Solomon Asch (1907–1996). Unlike Allen and David, who themselves embody human failings for laughs, Baron Cohen’s Bruno and Borat, while grotesque caricatures in themselves, chiefly point the finger of ridicule at others. Worse than merely “not very funny,” Baron Cohen’s pranks convey a negative view of humanity — not just of the comedian — as if they are the product of a superego so severe that it stamps out comedy entirely. Freud might have considered that the pleasure principle is outweighed by pain in the comic universe of Sacha Baron Cohen, closer to MTV’s “Jackass” than to the Marx Brothers, Mel Brooks, Rodney Dangerfield, Jack Benny or other greats of Jewish comedy.