What is Variable?

Web Development Jargons Explained in 4 Different Ways

TLDR: A variable is a temporary storage unit in a program. You can think of it as a box. You can use this box to hold an item. You can retrieve the item stored, or swap it with another item.


Explain like I only speak in plain English

A variable is a temporary storage unit in a program. You can think of it as a box. You can use this box to hold an item. We can retrieve the item stored, or swap it with another item any time we want.

We usually give names to variables. When we need to retrieve the item stored in a variable, we just call out the name of the variable. Variables are used very often to hold on to data temporarily in programs.

Explain like I'm a total nerd

In actual working, variables don't really keep values in it. Instead, variables store a reference link to the location of the values in memory. This gives rise to the occasion where multiple variables can reference the same value.

In most programming languages, the = assign operator is used to assign values to variables. We can use the = assign operator to change the value reference by a variable anytime we like.

In some programming languages, variables also have to be associated with a particular value type. Once this has been set, a variable can only reference values of that particular type. Such as either numbers, or strings.

Explain like I like videos

Explain like I already know it

The most difficult aspect about using variables is naming. Names need to reflect the meaning of the information the variables hold and must be easy to understand by peers.

We are trusted by

Students and instructors from world-class organizations

Imperial College London
Carnegie Mellon University
City University of Hong Kong
Hack Reactor
Cisco Meraki
University of Oxford
Swift
Bazaarvoice
Waterloo
Uber
AtlanTech
Tumblr
Boston College
Bombardier Aerospace
University of St. Andrews
New York University
Minerva Schools at KGI
Merrill Lynch
Riot Games
JP Morgan
Morgan Stanley
Advanced Placement®
Google
KPMG
The University of Hong Kong
University of Toronto
SCMP
Moat
Zynga
Hello Toby
Deloitte
Goldman Sachs
Yahoo
HSBC
General Assembly
Tesla
McGill University
Microsoft

Join the upcoming Cohort #72

Enroll for December 5th, 2022