Variable

VAIR-ee-uh-bul /ˈvɛəriəbəl/
nounadjectiveB2GRESAT
technicalformal

(noun) A quantity or function that may assume any of a set of values. (In programming) A named storage location that can hold a value, which may change during program execution. (adjective) Not consistent or having a fixed pattern; liable to change.

In programming, a variable is a fundamental concept for storing and manipulating data. It's like a labeled box where you can put different values at different times.

The story behind the word. The word 'variable' comes from the Latin 'variabilis,' meaning 'changeable.' This in turn comes from 'variare,' meaning 'to change.' In mathematics, it gained prominence in the 17th century to describe quantities that could take on different values. When early computer programming emerged, the concept of a named storage location whose value could change was a direct application of this mathematical idea, hence the adoption of 'variable.'

Word relationships

  • mutable (adjective): Specifically means 'able to be changed,' often used in programming contexts.
  • inconstant (adjective): Less formal, implies a lack of steadfastness.
  • factor (noun): A circumstance, fact, or influence that contributes to a result; broader than a programming variable.
  • constant: A value that does not change.
  • fixed: Not subject to change or alteration.

Commonly confused with

  • Constant: A variable's value can change; a constant's value remains fixed throughout the program's execution.

Word family

  • vary (verb): To differ in size, amount, degree, or nature from something else of the same general class.
  • variation (noun): A change or difference in condition, amount, or level, typically with certain limits.
  • variability (noun): The fact or quality of being liable to vary or change.

Collocations

  • declare a variable
  • assign a variable
  • local variable
  • global variable
  • independent variable
  • dependent variable

Example sentences

  • "The program uses a variable named 'score' to keep track of the player's points." In a programming context.
  • "In the equation y = 2x + 5, 'x' and 'y' are variables." In a mathematical context.
  • "The weather in spring is often highly variable, changing from sunny to rainy very quickly." As an adjective.

Memory hook

A 'VARIABLE' is like a 'VERY ABLE' container that can hold different things. Very Able Container

When not to use

Avoid using 'variable' when you mean a constant or a fixed value. The core idea is its ability to change.

Fun facts

  • The concept of variables is fundamental to almost all programming languages, allowing for dynamic and interactive software.
  • In some programming languages, you must explicitly 'declare' a variable before you can use it, specifying its type (e.g., number, text).

Related words

Function, Code

LangBlitz
Take your vocabulary further with LangBlitz

Our English vocabulary app: FSRS spaced repetition, 5,000+ curated words across 119 topic groups, CEFR A1 to C2. Explore your mastery with the beautiful Vocabulary World feature.