Sunday, March 25, 2007

Geek Jokes

You knew it would happen.

Last month I was teaching Sunday School when I said, "Sometimes trials come to strengthen, or even test your faith" and wrote on the chalkboard:

"faith = trials"

One of my friends who is a huge nerd (he's actually a programmer at the EvilEmpire, he really needs a blog name. Let me know if you think of one. Oh, he's also the one who dared me to write this poem.) pipped up, "Hey, that should be equals-equals (==)." I thought about it for a minute and said, "Well, it could actually be both, since it's both a comparator and an assignment." We laughed. Lurch laughed. Everyone else stared at us blankly.

For those of you who don't get it (all of you?) allow me to explain why it's so funny to us. In programming, as in algebra, if you have 'x = 5' then essentially you're saying that every time you see 'x' you replace it with '5'. So, faith = trials means that faith IS trials. Every time you have faith you will also have trials. Makes sense, yes?

Ok, now == in programming is a comparator operator, much like <=. So, if I say 'x <= 5' I'm asking: 'is x less than or equal to 5?' If I say 'x == 5' I'm asking (you guessed it) 'is x equal to 5?' So, by saying 'faith == trials' I'm asking, 'does faith equal trials?'

Trust me, it's funny.

Here's another joke that will lose all humor once I explain it:
Tonight the same geek friend and I are sitting around talking at some one's party. A girl we're with says something, and I kind of gave her a weird look. He turned to her (they're really good friends) and said, "Right now she's filing your name under 'idiot.'"

I smiled at him sweetly and said, "Actually, it's a hash, so it just collided with your name."

He pretended it wasn't funny, but then started to laugh. "That's actually pretty funny!" he exclaimed joyously. We tried to explain it to those around us. They didn't get it.

Here's why it's funny:
A hash function is a way of storing things in pairs. So, if you wanted to keep track of your friends by their name and a defining personality characteristic you might have (which means, Sally is fun) and and . You don't want to save your friends by their names because you want to just look up their personalities and know who to invite to your party. If you stored them alphabetically, then you'd have to look at Jane to know she's boring. However, if you store them in a hash table you just say, "I'm looking for all my friends who are fun" and you get a list of people who are fun. When more than one attribute (person, in this case) has the same key (personality characteristic), it's considered a collision. So, essentially, I was telling, "Yup, she's an idiot, but so are you." Ahh, good times.

Trust me, it's funny, too.

Ok, ok, that's it for geek jokes tonight. Sleep well!

2 Comments:

Anonymous Anonymous said...

I must be spending WAY too much time chatting with you, dear child, because I actually GET the / definination! Does that mean that you and Dad collide under the same hash???
(or am I showing my un-geekness again?)

April 01, 2007 11:39 am  
Blogger granola girl said...

Oh, no, you both totally collide, with the key of "weird"!! Love you mumsy!

April 01, 2007 11:04 pm  

Post a Comment

<< Home