Skip to main content

Command Palette

Search for a command to run...

The Guide To Understanding Variables

Published
2 min read
The Guide To Understanding Variables
D

Professional Biography:

In the technology realm, others see code. I see art. My journey as a software engineer is fueled by a steadfast conviction in the power of creativity to transform our world and the ability of technology to unleash human potential.

As a self-taught developer from Nigeria, I have taken a unique route fueled by a constant inquiry and an insatiable thirst for invention. I spent my five years as a developer growing from a lone learner to a versatile full-stack developer and enthusiast for artificial intelligence. Today, my technological landscape spans web development, artificial intelligence, and blockchain technologies, each established through learning about multiple frameworks.

Technical Skills:

In terms of technical skills, I possess a broad breadth and depth. I know multiple programming languages - Python, JavaScript, Ruby, and C - and possess exceptional knowledge of multiple web technologies - React, Next.js, Node.js, Django, and upcoming frameworks. When I approach code development, I don't just think of it as code. I think of it as compositions. Each line of code is like a musical note bringing functionality together to create a symphony.

Professional Philosophy:

More than skills, I have a vision to create opportunities. Having seen dauntless ambition and unmet creativity in uninviting environments, I believe technology has the possibility of leveling the playing field. I find coding far more relevant than code; to me, it's about giving people a chance to unearth their expression and potential.

Current Frontiers:

I'm currently digging deep into the intersections of AI, web development and blockchain technologies. My excitement surrounding cryptocurrencies and programmable assets stems from a mindset I have toward a more fluid, easier to access digital ecosystem. I view these technologies as tools for innovation rather than things that are far off in the future.

What The Hell Are Variables?

Well, simply put “variables are names you give to information that matter”. Makes sense? Try to imagine a scenario where you are asked to create a file containing basic information about yourself (name, age, gender), you would write something similar to this:

name: John Doe  
age: 24  
gender: male

In the above file, you have created three variables

  • name
  • age
  • gender

We call them variables because of their ability to change at any given time. So by next year, your age would be age + 1 , right? You get the logic!

Variables In Computer Programming

Variables are the names you give to computer memory locations that are used to store values in a computer program.

So in computer programs, variables are a lot more than just names, they are pointers to memory locations used to store values.

The value can be anything at all — a number, a text, a list of numbers, etc. The variables just point to the value, so anytime the computer sees that variable, it replaces it with the value it is pointing to.

name = "John Doe

Example 1

What happens when a variable refers to another variable?

When a variable refers to another variable, the value of the later is copied into the former. For example:

Example 2

Two variables can refer to the same value. So once the value of one variable changes, it does not affect the other variable.