Humor is a skill with many different (and often subtle) techniques, and so, to increase your capacity to generate laughs, one should study these techniques, and practice them often. However, one of the trickiest parts is figuring out just what these humor techniques are. I have not found too many great books on the subject, and have learned mostly through observation and failed experiment.
We begin our lesson by examining a technique which I have not been able to find a common name for, but more or less involves swapping virtue with vice in some moralistic context. Mark Twain is arguably the resident authority on this technique in America, and used it repeatedly. So, let us start with Twain’s famous essay On The Decay of the Art of Lying.
Preface: I hesitate to analyze the technique in much detail, since, as E.B. White points out, humor is not susceptible to scientific analysis, strictly speaking. As with an octopus, you’ll always inevitably kill the specimen under examination, when attempting to dissect it. So, the best way to learn the technique is to simply observe it alive in its natural habitat, then emulate.
Part of what makes something funny is surprise – but not just surprise. Specifically, surprise which is connected to deeper, often unspoken truth: that is the critical element for something to be considerably funny. It is, of course, surprising to discuss lying as a virtue, but it is also true – for anybody who pays five minutes attention to politics – to see how ineffectual truth-telling is when compared to what Twain calls a properly scientific lie. Surprising, yes, but speaking toward an otherwise obvious and unfortunate reality. That, I suggest, is what makes this essay especially uproarious.
One more example, just for fun.
*Here the logician in me must balk a little: the deduction is not plain, as Twain has it. For a valid conversion (contraposition, say) of the initial proposition would be: If all children tell the truth, then, if someone doesn’t tell the truth, that someone is not a child. (i.e. if all A = B, then all not-B = not-A.) The point is, one cannot infer from the original claim that non-children always lie; they could also tell the truth, even if they don’t always. Of course, this is not the point of Twain’s piece, and I have probably just ruined the fun, haven’t I?