What is a variable?
This question is important for philosophical reasons.
Wikipedia defines it as:
a symbolic name associated with a value and whose associated value may be changed
I would say this is a very solid generic definition for a variable. If you want to expand it slightly, you could add that the value is represented by a block of system memory, but this reduces the generalness somewhat.
I'm not sure you're going to get any deeper a definition, if you were hoping for that...
In C#, you'd declare the What variable as:
object What;
Your declaration seems to be from some kind of English-like programming language. Does the ? indicate nullability?
</lameAttemptAtHumour>
Osborn's Law: "Osborn's Law: Variables won't; constants aren't." :)
Wikipedia has entries for both programming variables and mathematical variables
Variables in most programming languages are mutable - they are buckets that can hold a piece of information with a symbolic name for a period of time.
In functional languages, such as XQuery or XSLT, they cannot be changed once assigned. The same is true of final
variables in Java, or const
variables in most programming languages.