Two strings walk into a bar and sit down

Two strings walk into a bar and sit down. The bartender says, “So what’ll it be?”
The first string says, “I think I’ll have a beer quag fulk boorg jdk^CjfdLk jk3s d#f67howe%^U r89nvy~~owmc63^Dz x.xvcu”
“Please excuse my friend,” the second string says, “He isn’t null-terminated.”


This is another programming joke. I couldn't imagine the jokester actually saying the thing that the first string is reported to have said, so this joke probably only exists in written form.

The humor here relies on the listener to understand that some programming languages put nulls as the end of strings to denote where the string ends. It also requires that the listener remembers that some programming languages do not automatically terminate strings with nulls, and leave that job to the programmer.

If the programmer writes a bug, strings can lose their null terminators, and then when you try to print them to the screen they will print all sorts of gibberish until they come across a null that happened to exist in memory.

Really, I don't find this joke funny at all except when I try to imagine a person saying the thing that the first string is supposed to have said.

Comments

Popular posts from this blog