For a nerdy take on it, read John Allen Paulos's book "Mathematics and Humor." It has been quite some time since I've read it so I don't remember if there are any practical takeaways, but I remember I enjoyed it.
Keep in mind there is a big difference between doing stand up comedy and writing jokes. Many stand up comics don't write their own jokes and most joke writers don't have the stage presence to be stand up comics. There is also a big difference between a joke intended to be read and a joke intended to be heard.