This section contains 504 words (approx. 2 pages at 300 words per page) |
A line of a program that causes power to be temporarily transferred to a subroutine is a call. Efficient computer programmers avoid repeatedly writing lines of code throughout their programs that achieve the same end. If a program must perform a complicated calculation several times throughout the course of its execution, and the calculation requires thirty or forty lines of code to produce an answer, programmers often write the lines of code that represent the calculation as a subroutine. Because subroutines are essentially miniature programs that are able to function independently of the program in which they are embedded, they by definition have a clear beginning and end. Often, programmers place all subroutines at the end of the main program and write lines of code within the program that cause the various subroutines to be executed before the program continues.
A simple computer game written in BASIC, for...
This section contains 504 words (approx. 2 pages at 300 words per page) |