Writing code, comments, variable names, etc., in the manner that they create a pun.

This is a common and fun practice, but it can be an AntiPattern. Making a pun can detract from the readability of the code. (See MeaningfulNames.) Plus, if you work with the code long enough, some jokes can tire to the point of becoming completely annoying.

Alternately, simply a class of puns which require programming knowledge to be understood.

When a friend of mine and I were writing an oberon compiler for a class, we would give our objects humorous names, calling the symbol table class "Wingdings", our scope object "Tele", and our Token class "JRR" -- JacobCohen

I frequently add the following commands to my makefile (I am not the originator, I saw this in a makefile myself):

love: /dev/null
@echo not war?

It is surprising how many people have just happened to type "make love" and be amused at the response!

Q: Why did the functions stop calling each other?
A: Because they had constant arguments.

That was so bad that it overflew my stack.

HaHaOnlySerious: this has happened to me when I forgot to refactor a method in all the classes in an inheritance chain to have the same const-ness.
There are 10 kinds of people in the world: those who understand binary, and those who don't.

There are only 10 kinds of people in the world: those who understand binary, those who don't, and 8 other kinds.
How does a computer scientist order three beers? He holds up two fingers. -- SriramGopalan

While travelling, I discovered that some cultures count starting with the thumb=1, one finger (and thumb) = 2, two fingers (and thumb) = 3.
A while back, I was explaining something about the use of Boolean variables to a friend, and he came up with "I tried to pass a Boolean once - it was really painful. Then I took a conditional, and I felt much better."

I must apologize ahead of time ...

Q: How does Kent Beck like his Pop-Tarts?

A: Toast-first.

hmm, I thought he likes to have 2 people push the tart into one toaster and pops it out every few seconds to nibble and test if it's perfect and make position/heat changes. When done, only writing '7/10/06 one pop tart' as documentation.

The problem with C++ is that all of your friends can see your private parts.