Why did the programmer get stuck in the shower?

By Laura Sach. Posted

Originally published in Hello World 20: Systems and networks, Jan 2023. All information true at the time of original publishing.

Laura Sach shares some programming jokes to add a touch of humour to your teaching

Dad jokes to make my students laugh (or groan) were always popular in class. Here are some jokes for you to inflict upon your students at timely moments in your teaching. I’ve broken down the jokes to relate to teaching topics, because jokes are only truly funny when they are explained, right?

“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:

Octal 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!

!false

(It’s funny because it’s true.)

In many programming languages, the ! operator means ‘not’. So ‘!false’ means ‘true’.

[“hip”, “hip”]

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”.


Techy one-liners

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.


Print

Free - UK only

If you’re a UK-based teacher, volunteer, librarian or something in between, we'll send each issue free to your door.

Digital

Free

Just want to read the free PDF? Get each new issue delivered straight to your inbox. No fuss and no spam.

Buy

From £6

If you’re not a UK-based educator, you can buy print copies from our store.