Part of the Programming glossary:

In computer programming, routine and subroutine are general and nearly synonymous terms for any sequence of code that is intended to be called and used repeatedly during the executable of a program. This makes the program shorter and easier to write (and also to read when necessary). The main sequence of logic in a program can branch off to a common routine when necessary. When finished, the routine branches back to the next sequential instruction following the instruction that branched to it. A routine may also be useful in more than one program and save other programmers from having to write code than can be shared.

Typically, in assembler languages, a routine that requires some variable input can be encoded into a macro definition with a specified interface called a macro instruction . The programmer can then use a macro instruction instead of having to include and manage the branching to a routine. Macro definitions and instructions also tend to be shared among programmers for use in multiple programs, especially in software development projects.

In higher-level computer languages, many commonly-needed routines are prepackaged as function , which are routines with specified programming interfaces. Some functions can be compiled in line with other code. Other functions are compiled in as stub that make dynamic calls for system services during program execution. Functions are sometimes called library routines . The compiler and a set of library routines usually come as part of a related software development package.

In Windows and some other personal computer operating systems, the system routines for handling specific tasks such as interacting with specific I/O devices are called dynamic link library ( dynamic link library ) routines. These routines are dynamic because their files are not actually loaded into memory until the first time they are called.

A more recent term, procedure , is similar in meaning.

This was last updated in April 2005
Contributor(s): Selena Ozuna
Posted by: Margaret Rouse

Related Terms

Definitions

Glossaries

  • Programming

    - Terms related to software programming, including definitions about programming languages and words and phrases about software design, coding, testing and debugging.

  • Internet applications

    - This WhatIs.com glossary contains terms related to Internet applications, including definitions about Software as a Service (SaaS) delivery models and words and phrases about web sites, e-commerce ...

Ask a Question. Find an Answer.Powered by ITKnowledgeExchange.com

Ask An IT Question

Get answers from your peers on your most technical challenges

Ask Question
  • RPG Move command

    INZ initializes a variable, it intelligently move values according to data types. Secondly I have seen Z-ADD or ADD to move numeric values in numeric variables rather then just MOVE. MOVE is more s...

  • How to debug piece of code added as CPYSRC

    I will sometimes compile the program to QTEMP to debug. Then you will get an expanded source QRPGLESRC in QTEMP with the copy source included. Then just debug this and you should be fine.Forgot to ...

  • Call stack of an RPG program

    Try this Link: http://www.itjungle.com/fhg/fhg091113-story01.htmland let me know.

Tech TalkComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.