Functions and procedures have parameters. These parameters are bound or assigned to arguments when the function or procedure is called or executed.
Consider the C function declaration:
double square(double x) { return x * x; }
In this case x is the parameter. When the square function is called:
square(2 + 3);
the argument 5 is bound to the parameter x:
return x * x where x = 5
Of course a function can be called many times in many places with different arguments:
square(-1) + square(3) * square(8 * 6)
Consider the C procedure declaration:
void clear(double* v) { *v = 0.0; }
In this case v is the parameter.
Assume a variable named "temp" is declared:
double temp = 98.6; /* temperature of patient */
When the clear procedure is called:
clear(&temp); /* &temp = the address of temp */
the argument &temp is bound to the parameter v:
*v = 0 where v = &temp /* so now temp contains 0.0 */
In theory, the difference between a function and a procedure is that a function computes and returns a value, while a procedure updates one or more variables and returns nothing (void). Since expressions are program phrases that compute values when executed and commands are program phrases that update variables when executed, we can say that a function is a parameterized expression, while a procedure is a parameterized command.
In practice, C functions are hybrids that can also update variables and so the distinction between functions and procedures isn't made.
In addition to expressions that compute values and commands that update variables, programming languages provide a third type of phrase: declarations. When executed, a declaration binds or associates a name to a value.
For example, the three declarations above bound the name "square" to a function, the name "temp" to a variable, and the name "clear" to a procedure:
square = [function]
temp = [variable]
clear = [procedure]
If a function is a parameterized expression and a command is a parameterized command, then a generic is a parameterized declaration. These parameters can be bound to arguments each time the declaration is executed.
A generic algorithm (function or procedure) is an algorithm that doesn't care about the type of data it manipulates.
A generic type is a type that doesn't care about the types of its components.
Collectively, functions, procedures, and generics are called abstracts because they facilitate the Abstraction Principle by separating the development of an algorithm (expression, command, or declaration) from its use or execution.