Unfortunately most jokes here, as on most forums, fail on both counts. The most common way to fail (a) seems to be to recycle overused catch phrases in insufficiently novel ways.
Good:
A joke that is relative to the subject. As in replying with code one liners when another member posts one. This one is quite enjoyable.
Bad:
One liners like "That's what she said!".
Though I think a thread about hacker jokes could come in handy from time to time. We are quite the uptight community.
"Two hunters are out in the woods when one of them collapses. He doesn’t seem to be breathing and his eyes are glazed. The other guy whips out his phone and calls the emergency services. He gasps, “My friend is dead! What can I do?”. The operator says “Calm down. I can help. First, let’s make sure he’s dead.” There is a silence, then a shot is heard. Back on the phone, the guy says “OK, now what?”
However! In the context of Hacker News, where the goal seems to be knowledge transfer, (b) is important as the joke should be a way to frame the knowledge transfer process.
If you use comment scores as a proxy for agree/disagree you are much more likely to downvote comments you don't agree with even if they add to the discussion.
That said, it seems like it would be hard to control for only occasional (and ideally funny) jokes in a community like this -- if jokes were generally rewarded, hn could become a jokefest like Reddit, dramatically reducing the signal-to-noise ration many of us appreciate it for.
TL;DR - use jokes sparingly, and make 'em good.
(edited for a typo)