Hacker News new | ask | show | jobs
by protomolecule 996 days ago
So why do we need variables?
2 comments

It is a broad question, so here’s a broad answer:

A computer program is a sequence of instructions for the computer to follow, to transform some input into some output. To write useful and interesting programs, it is helpful to have some way of representing quantities which might change depending on those inputs.

I hope the question isn’t intended to have a single “right” answer because it’s very vague.