“There are 10 types of people in the world: those who understand binary and those who don’t.”
I have to start with this one, because it’s the ultimate computing teacher joke. It only works when written down, though, because the 10 in question is not actually ‘ten’ but ‘one zero’, which in binary represents the number two.
Q: Why did the parrot say “pieces of nine”?
A: He had a parroty error.
The proverbial pirate’s parrot usually says “pieces of eight”, but in this case the number is incorrect. When data is transmitted across a network, a parity check might be performed on the bytes sent and received, to try to detect errors during transmission. For example, if a connection requires even parity, you would expect all bytes received to have an even number of 1s. This can be achieved by designating a ‘parity bit’, usually at the end of the data, to ensure that the number of 1s transmitted is even. For example, if we sent the number 8 — 00010001 — we would need to set the final parity bit to 1 to ensure an even number of 1s. If this byte was then received as 00010011, the receiver would know there was a problem because there was a parity error, in this case an odd number of 1s.
Q: Why do programmers get confused between Halloween and Christmas?
A: Because Oct 31 = Dec 25.
This is a number base joke. Dec refers to decimal (or denary), our most frequently used base-10 numbering system. Oct in this case refers to octal, which is base-8, where each place value is a power of 8:
We can convert the value 31 in octal to decimal by multiplying each digit by the place value and adding the results together: 8*3 + 1*1 = 25. Thus, Oct 31 is Dec 25.
Q: Why did the programmer get stuck in the shower?
A: Because the shampoo bottle said ‘lather, rinse, repeat’.
This one is a reference to an infinite loop: the instructions on the shampoo bottle don’t explicitly tell you to stop washing your hair, but most humans don’t follow instructions literally like computers!
(It’s funny because it’s true.)
In many programming languages, the ! operator means ‘not’. So ‘!false’ means ‘true’.
This is one of my favourites when tackling arrays with students. The joke is “hip hip array” — but if you’re teaching with Python, you’re bound to get one smart cookie who points out that in Python it’s technically “hip hip list”.
Throw in these one-liners to guarantee a groan, or perhaps set as a starter activity to explain why they are funny:
I love pressing the F5 key; it’s refreshing.
My friend’s band is called 999MB. They haven’t got a gig yet.
I’d tell you an infinite loop joke, but you’d never hear the end of it.
walks a packet UDP A bar into.