In order for humor to be effective, it must serve a purpose. Sometimes that purpose is nothing more than a welcome break from the routine. Other times the purpose is to stress a point. That joke got laughs from the group attending the dinner party where it was told. It would have been less effective had my friend actually said that to his boss.
Discretion is as important as good timing.
If your attempt at wit is too different from your own personality style, you won't be effective. The comedian almost becomes a character, constantly working from a script being played out for the audience. Based on his or her answers, you become convinced that the show host is asking the comedian questions that are simply a continuation of his or her routine. You'll be less effective if it seems like you're following a script from which you can't stray. The only way anybody will ever see my ribs again is if I'm under general anesthesia.