
Ask HN: What is a good analogy for a variable - tosh
When teaching programming analogies can help (familiarity) to convey concepts. At the same time some analogies work better than others. What are your thoughts on this?
======
karmakaze
A variable is first and perhaps foremost a name by which a value is accessed.

In some/most languages a different value can be associated with the name,
and/or the value-thing can be changed/mutated.

Not an analogy, but a good start. Then have to describe different kinds of
values and maybe references. Easier to do in parts than all at once as a
'variable'.

------
pella
[https://www.theschoolrun.com/what-is-a-variable-in-
computing](https://www.theschoolrun.com/what-is-a-variable-in-computing)

