What metaphor would best describe the relationship between 'Value' and 'Type'?

78 views Asked by At

I'm trying to draw comic explaining 'value' and 'type' accurately, and I'm having a major problem: The way people use the term "type" compared to "value" in sources everywhere is driving me mad. I keep reading definitions in various metaphors:

  1. A 'type' is an empty shell of properties, and a 'value' is what fills it in.

  2. A 'type' is a factory that 'values' are built from.

  3. A 'type' is a blueprint of a factory that creates 'values'

  4. A 'type' is a rulebook telling what a 'value' can do.

  5. A 'type' is an identification label for a 'value' that already has innate properties built in.

  6. A 'type' is a organization chamber that 'values' reside before they get summoned into a program.

Worse is I keep hearing "Type" used as the adjective "Typed," which confuses me even more: Isn't type a noun? Plus, it feels like there are multiple definitions and contexts going on whenever someone uses this term. I feel like it is impossible to explain what a 'type' is without people getting really nit-picky about the details.

I don't know where to really ask this question, but I've been reading for days on end to no reasonable answer. How I should visualize 'type', and how it relates to 'value'? And which of my 6 interpretations would people be the least nitpicky about? My head really hurts right now...

My comics would explain the concepts in Python, but depending on the answers, I could try to explain programming concepts in a language-neutral manner.

1

There are 1 answers

6
trndjc On

A type is like a sports team and a value is like one of its players. The New York Knicks are just a logo, a jersey, a set of colors, a name. It takes a player to wear that jersey and represent that team to make the Knicks anything of value (pun). If the Knicks are a type, Patrick Ewing is one of its values.