Definition - What does Variable mean?

A variable, in the context of programming, is a symbolic name given to an unknown quantity that permits the name to be used independent of the information it represents. Variables are associated with data storage locations, and values of a variable are normally changed during the course of program execution. Variables represent all kinds of data, including booleans, names, integers, arrays, pictures, sounds, scalars, strings, or any object or class of objects depending on the programming language that supports them. The symbolic names of variables are replaced with the actual data location by compilers and interpreters. Data in locations changes during execution while locations and names are fixed.

Techopedia explains Variable

A variable is assigned a value in one place and then used repetitively. Variables generally have four attributes: an identifier, data location, type and value. They are assigned during program execution at different times. In a few instances, non-identical identifiers may refer to the same location, variable, and value. Variable types specify the kind of information stored in a variable. They also describe the format of the value stored, memory occupied, and methods for manipulating and expressing the content.

Programming variables are normally represented using multiple-character names. Single-character names are normally used to represent auxiliary variables (for example, a loop variable might be named i). Naming of variables is supported at different language levels and is part of the language syntax. Most languages allow an underscore in variable names.

Programmers follow code style guidelines to name variables. Short names are less descriptive but easy to type, whereas long names can specify the purpose of a variable in the program. For example, the syntax int temp=0; in JAVA or C++, "temp" is the variable name; the type of variable is integer and its value is 0.

The scope of a variable determines the use of a variable in a program. A variable’s scope is the part of the program code in which the variable is visible and has a meaning. Memory space is allocated to a variable when the variable is first used and deallocated when it is no longer needed. If variables are declared and not used, compilers normally issue a warning.

This definition was written in the context of Programming
Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.