value is a constant a name represents something else
In my family we all have nicknames. My brother is named Ramiro, but
we call him Pelon. My other brother Stewart is called Tui, my sister
Regina is Nena. My husband thought that I had 6 siblings instead of
3. Both names respresent the one value of a person.
Variables allow a user to provide a value on the fly or allow us to
easily change the input to an equation. They also provide for more
understandable code because we then know what the value may represent.
5 is not very informative. radius is more informative.
A function can be defined and named like a variable
A function can break down a problem by taking one part
- in particular a repeatable part - and allowing that piece of the
logic to happen within the function. Then we just call the function without
having to worry about those details. It also allows us to break up the work.
If we agree what functions need to be written and what we are expecting from them
then we can let one person tackle each function and then call the as needed
without having to worry about how it's all done on the inside.
An example may be like a webservice to process a banking transaction.
I can call a function and pass arguments of to account, from account and amount
and the web service takes care of the details and just lets me know that it
processed or didn't. Simple and secure!