It boggles my mind that it's simply
difficult for just regular average people to understand what, conceptually, a variable
is. And I don't mean within programming specifically. I took it as a given that a fundamental understanding of a variable as a stand-in was something all people had because of standardized math education, but I am clearly wrong. Anyway, I thought to myself "how would I describe it most succinctly?", arrived at a good answer, and thought to share it with you.
Why? I don't know! He's on third, and I don't
give a damn.
A variable is a word/name/symbol that represents some value or some other object, that you use for one of three possible reasons:
- You don't know what the value is.
- You don't want to pick a value now, and instead want to allow yourself to easily choose a value later.
- You want a more descriptive way to refer to something instead of the value itself, which might not be clear.
A variable is shorthand to refer to something else... because you actually don't know what the thing is, do know but don't want to decide what it should be now, or think using the thing directly could be confusing.
Anyway, just me yapping as the thought occurred to me while browsing lol