It's quite similar to guitar solos, only with programming you have to use your brain. The most important thing is that it should have some emotional effect on me, rather than just, 'Oh, that's really clever.'
It is not knowledge, but the act of learning, not possession but the act of getting there, which grants the greatest enjoyment.