Rumpelstiltskin versus the five-legged-dog

Rumpelstiltskin

I first heard of Rumpelstiltskin while watching one of Professor Patrick Henry Winston's lectures on artificial intelligence:

https://youtu.be/09mb78oiPkA?t=839

It's part of a free MIT online course, and the lecture content is transferable outside of the field of artificial intelligence.


I love fairy tales, but what does Rumpelstiltskin have to do with programming?

The Rumpelstiltskin Principle is the idea that giving a name to something gives you power over it. So, we can choose names for our design, tests, variables, classes, or methods to direct our thoughts and structure our solution. They can help us think about what the program is doing.

The Five-Legged-Dog

"If you call a tail a leg, how many legs does a dog have?"

(the answer is four, of course, because calling a tail a leg doesn't make it a leg)

-- Gerald Weinberg

Listen to his amazing conversation here about naming things:

https://www.youtube.com/watch?v=Ew-M1oAdVE0

It's a fantastic perspective that showcases a tester's mind. People can confuse the act of naming something with what that something truly is or does. A description is different than a name.

Heroic Code

I try to negotiate between using a name's power to restrict or confuse and its power to clarify and enable.

I name things as if they were characters in a movie. So, for example, if I have a class managing time, I might call it the Moirai, after the Greek gods that managed the threads of fate. That gives me a general idea of what it does, but it also is transformed into a heroic character that inspires me to innovate.