Variables in Math vs Programming

TheDevStory
2 min readApr 8, 2024

--

Variables are like labels we use both in math and programming, but they have different jobs in each field.

Math

  • What They Are: Like nametags for unknown or any numbers we want to talk about.
  • Their Job: Help us explore how numbers relate to each other and solve puzzles with numbers.
  • Why We Use Them: To think about number problems in a big-picture way, making it easier to understand patterns and solve equations.

Programming

  • What They Are: Like boxes in a computer’s memory where we can keep and change information as our program runs.
  • Their Job: Hold onto information so we can do things with it, like calculations or making decisions.
  • Why We Use Them: To get stuff done in our programs, like organizing information, making choices, or repeating tasks efficiently.
Variable In Programing 1
Variable In Programing 2

The Big Picture

For programmers, it’s really helpful to get how these different kinds of variables work. Math variables are all about thinking broadly and finding patterns, while programming variables are about holding and working with information in a hands-on way. Even though they do different things, at heart, they’re both about working with information — whether that’s solving a math problem or telling a computer what to do. Understanding this can make us better at thinking through problems and coming up with solutions, no matter if we’re working with numbers or coding

--

--

TheDevStory

A web developer crafting online experiences. Also football(soccer) coach and Spanish Learner.