Samuel Butler said this quote

A sense of humor keen enough to show a man his own absurdities will keep him from the commission of all sins, or nearly all, save those worth committing.