🔵 🔵 🔵


Primary

၊၊||၊|။

Variable ○꠹ᴾᴿᴳᴿᴹ|Definition|1st|20251119205401-00-⌔

Variable (computer science) - Wikipedia

Variable (high-level programming language)

In some high-level programming languages, a variable is an abstract storage or indirection location paired with an associated symbolic name, which contains some known or unknown quantity of data or object referred to as a value; or in simpler terms, a variable is a named container for a particular set of bits or type of data (like integer, float, string, etc…) or undefined.1 In some other languages such as BASIC, Python, or Ruby — a variable is more accurately described as a name associated with a value, with memory allocation handled transparently by the interpreter or runtime. A variable can eventually be associated with or identified by a memory address. The variable name is the usual way to reference the stored value, in addition to referring to the variable itself, depending on the context. This separation of name and content allows the name to be used independently of the exact information it represents. The identifier in computer source code can be bound to a value during run time, and the value of the variable may thus change during the course of program execution.2345

Variables in programming may not directly correspond to the concept of variables in mathematics. The latter is abstract, having no reference to a physical object such as storage location. The value of a computing variable is not necessarily part of an equation or formula as in mathematics. Furthermore, the variables can also be constants if the value is defined statically. Variables in computer programming are frequently given long names to make them relatively descriptive of their use, whereas variables in mathematics often have terse, one- or two-character names for brevity in transcription and manipulation.

A variable’s storage location may be referenced by several different identifiers, a situation known as aliasing. Assigning a value to the variable using one of the identifiers will change the value that can be accessed through the other identifiers.

Compilers have to replace variables’symbolic names with the actual locations of the data. While a variable’s name, type, and location often remain fixed, the data stored in the location may be changed during program execution.

Printed 2026-06-28.

(echo:: @ )

Footnotes

  1. Brookshear 2019, p. 249, “Variables and Data Types”, “high-level programming languages allow locations in main memory to be referenced by descriptive names rather than by numeric addresses.”

  2. Aho, Alfred V.; Sethi, Ravi; Ullman, Jeffrey D. (1986), Compilers: Principles, Techniques, and Tools, pp. 26–28, Bibcode:1986cptt.book…A

  3. Knuth, Donald (1997). The Art of Computer Programming. Vol. 1 (3rd ed.). Reading, Massachusetts: Addison-Wesley. pp. 3–4. ISBN 0-201-89683-4.

  4. “Programming with variables”. Khan Academy. Retrieved 23 March 2020.

  5. “Scratch for Budding Coders”. Harvard. Archived from the original on 23 March 2020. Retrieved 23 March 2020.

Link to original

Secondary

• • •