James Gray said this quote

The key to humor is often self-loathing or sarcasm. In a sense, that's how self-loathing is made palatable.