Choosing to use internal or external subroutines or functions
To determine whether to make a subroutine or function internal
or external, you might consider factors, such as:
- Size of the subroutine or function. Very large subroutines and functions often are external, whereas small ones fit easily within the calling program.
- How you want to pass information. It is quicker to pass information through variables in an internal subroutine or function. The next topic describes passing information this way.
- Whether the subroutine or function might be of value to more than one program or user. If so, an external subroutine or function is preferable.
- Performance. For functions, the language processor searches for an internal function before it searches for an external function.