Function

From GPWiki

This page is far from complete, go ahead and write some more!
You can extend this page by editing it.

Definition

Functions, also known as subroutines, procedures, or methods, are groups of computer code that can be declared once and then reused throughout a program, saving programming time and reducing the size of the binary executable. They are similar to mathematical functions, in that they can receive input, process that input, and produce a calculated result. However, computer subroutines are more sophisticated, with the ability to do anything normal computer code can do.

Usage

Generally functions should be any piece of code found in more than one place. They can also be used for organizational purposes when a programmer wants to break a very long function into smaller pieces.

See Also

Wikipedia article on Function (computer science)