I've never thought of this issue until recently when I've been using Haskell to build a substantial project. In Haskell (and functional programming languages in general), most so-called "variables" are actually mathematical variables, which seem to be immutable by definition.
This made me quite confused. "Variables" in imperative programming languages make perfect sense because they indeed are mutated often. However, such a denomination seems very weird when the thing it represents is actually invariable.
Since the word "variable" originated from mathematics and has been in use for several decades, I'm curious how such an apparent self-contradiction came into existence in the beginning. Did people have a different idea in mind when they first invented the word, and it evolved over time to its current meaning? Was immutability not an important concern at that time such that it was overlooked? Or did I just get it wrong and "variables" in mathematics are actually not totally immutable after all?
A variable in mathematics is a symbol, rather than something (e.g., a number) which is denoted or by such symbol. There are no "variable numbers".
From : Bertrand Russell, Introduction to Mathematical Philosophy (1919), page 155-56 :