By Mark Damon Hughes <kamikaze@kuoi.asui.uidaho.edu>
"Dying is easy. Comedy is hard."
-Sir Donald Wolfit
Not every game should have humor - if you're trying for a serious tone, then even one bad programmer's joke can wreck the game.
There are two kinds of humor, which I just refer to as parody and slapstick (it's more complicated than that, but those make good labels).
Parodies have a funny premise, and if you stick to that premise and follow it to its logical conclusion, it'll get funnier and funnier without any jokes. Most of the best parodies are completely serious and deadpan. Terry Pratchett's books are the best example.
Slapstick is based on the fact that if you throw enough jokes at someone, no matter how dumb the jokes are, they will eventually laugh at one, and once you start laughing, it's hard to stop.