Forgot your password?  

Not What You Meant?  There are 15 definitions for Sub.  Also try: Routine or Nan or Caller.

Subroutine | Research & Encyclopedia Articles

Print-Friendly   Order the PDF version   Order the RTF version
About 1 pages (295 words)
Subroutine Summary

 


Subroutine

A subroutine, which can also be commonly called a routine, is a section of a computer program that performs a particular task. Subroutines are sets of computer instructions that exist and run within a program.

Computer programs can be written as a single document. However, this format can be cumbersome when checking for programming defects. Accordingly, many programs are now written in more easily managed sections. Each of these sections, which can also be termed a module (or modulus), is made up of one or more subroutines/routines. The concerted performance of the various tasks specified by the subroutines enables the program to function.

Subroutines can be used repeatedly during the execution of a program. This makes a program shorter and easier to write, as redundant sections are eliminated. A subroutine can be invoked during the running of a program and, when finished, that subroutine can branch back to the next instruction following the one that branched to it.

Subroutines are often parts of computational programs. Following a prompted format, the user inputs data (for example, a number specifying a temperature in degrees Celsius) the program then immediately accesses a conversion subroutine to add 273.15 to the number to convert the number to the Kelvin scale) the use of the input and conversion subroutine saves many programming lines that would otherwise be dedicated to performing this repetitious task for separate data entry items. Branching to subroutines also permits programs to directly access needed programming steps without having to run through unneeded code.

A subroutine may also be useful in more than one program and a subroutine code may be capable of being shared by multiple programs. Subroutines may also be packaged together with an interface to allow their use for a specific function such as those exemplified by Library routines.

This is the complete article, containing 295 words (approx. 1 page at 300 words per page).

More Information
  • View Subroutine Study Pack
  • 15 Alternative Definitions
  • Search Results for "Subroutine"
  • More Products on This Subject
    Conditional Control Transfer
    Conditional control transfer was proposed by John von Neumann in the mid 1940s. His concept held th... more


    Ask any question on Subroutine and get it answered FAST!
    Answer questions in BookRags Q&A and earn points toward
    discounted or even FREE Study Guides and other BookRags products!
    Learn more about BookRags Q&A
    Copyrights
    Subroutine from World of Computer Science. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.

    Join BookRagslearn moreJoin BookRags

    Join BookRagslearn moreJoin BookRags