When you code, you usually need to store information that you want to reuse later. For example, the name of your Codémon or its level. To do that, you are going to use variables.
a variable
A variable is a space in your computer's memory that stores information. More precisely, 3 informations:
- A Name → how we refer to it
- A Type → what kind of data it holds
- A Value → the data it contains
Name or Address in Memory?
In programming, we often use the term "name" to refer to a variable. However, in reality, a variable is more like an address in memory where data is stored. The name is just a convenient way for us to refer to that address.
It's like using an address to find a house instead of remembering the house's latitude and longitude.