The Joke is a historical novel by Milan Kundera.
The protagonist, Ludvik, while in his youth is smitten with a fellow student named Marketa. Feeling a lack of self-assurance, Ludvik uses sarcastic humor in order to "show off." When Marketa enthusiastically praises her Marxist summer camp, Ludvik writes her a postcard he believes to be humorous.
...I too believed in the imminence of a revolution in Western Europe; there was only one thing I could not accept: that she should be so happy when I was missing her so much. So I bought a postcard and... wrote: Optimism is the opium of the people! A healthy atmosphere stinks of stupidity! Long live Trotsky!
(Kundera, The Joke)
The plot is then set in motion as Marketa fails to get the joke and Ludvik is sent to prison for mocking the Party.
Ludvik thinks that Marketa is taking her studies too seriously; he thinks that levity is allowable while still holding to Marxist ideals. However, in his humor he fails to understand a fundamental principle of Marxism: it cannot allow the Individual to think freely, even in a humorous way. Ludvik writes: "Long Live Trotsky!" He means it in a sarcastic way, but since Trotsky had become Stalin's rival, and Stalin was worshiped as the head of all Marxists, even joking allegiance to Trotsky is seen as treason. When he mocks optimism and a "healthy atmosphere," he is actually mocking Marketa's serious nature, but is interpreted as mocking the actual teachings of Karl Marx. In this way, the "joke" is that while Ludvik believes in Marxism, it cannot allow him to be an individual and therefore rejects him.