- Also called modules, subprograms, procedures, routines
- A self-contained collection of steps that solves a problem or subproblem
- Each function should do one thing, but do it well
- Allows for structured programming—organizing communication between modules
- Easier to understand, test and debug
- Concrete step—a step for which the implementation details are fully specified
- Abstract step—a step for which some implementation details remain unspecified
- Functional Cohesion—A property of a function or module in which all concrete steps are directed towards solving just one problem
The form for a user-defined function is:
<type> <function name> (<parameter list>)
{
<data declarations>
<executable statements>
}