AI-generated image

subroutine

Pronunciation: /ˈsʌbruːtiːn/ noun · British & US
Allowed in UK word gamesAllowed in US word games

What does subroutine mean?

A subroutine is a distinct part of a computer program that performs a particular task and is invoked when needed. Its name allows the same instructions to be reused without repeating them throughout the main program. Subroutines help make programs easier to read, test, maintain, and modify, although the term also has a broader, less common metaphorical use for a subordinate procedure within a larger process. In technical writing, it is related to but more specific than the general word “routine”: a routine describes a regular sequence of operations, whereas a subroutine is a defined, callable section of a program. The word is especially familiar to programmers and computer science students, but it can also be used humorously when describing a repeated task or a small part of a larger operation.

noun

A named section of a computer program that performs a specified task and can be called from the main program or another routine.

Example

"The validation subroutine checks the format of the entered data."

In modern programming, the related terms function, method, and procedure may be preferred because they describe particular kinds of callable program units.

noun

A subordinate procedure or process within a larger activity.

Example

"Preparing the local briefing became a subroutine of the broader campaign plan."

This figurative use is uncommon and usually carries a technical or metaphorical tone.

Plural subroutines

The plural is formed by adding -s to the end of the word.

Example

"The developer tested several subroutines for errors before deploying the application."

Did you know?

A subroutine lets a program reuse instructions instead of rewriting them, turning a long process into manageable pieces.

Reviewed by Deb Chak, Editor. AI-assisted content curated by RJS Tech Solutions LLP.

Where does subroutine come from?

The word was formed in the mid-20th century from the prefix sub-, meaning “under” or “secondary,” and routine, meaning a regularly performed sequence of operations. In its computing sense, it developed as a name for a subordinate part of a program that could be called by the main program. The same prefix also underlies related technical words such as subprogram, subprocedure, subalgorithm, and substructure.

subprogramsubproceduresubalgorithmsubstructure

Related word forms

subroutinessubroutinedsubroutining

How subroutine is actually used

In computing, the term is chiefly used in technical documentation and discussion. Outside computing, it is relatively uncommon and can sound deliberately technical or metaphorical.

Easily confused with subroutine

routine

A routine is the general concept of a regular sequence of instructions or actions, while a subroutine is a specifically named, separately defined section of a program that performs a task.

What's another word for subroutine?

Words and phrases paired with subroutine

call a subroutinesubroutine callreturn from a subroutine

What's the opposite of subroutine?

main programmain routine