subprograms

Nested callable units

Subprograms are self-contained sections of code within a larger program, designed to perform specific tasks.

Functions and subroutines are the main types.

A subprogram can be called repeatedly from different points in the main program, avoiding redundant code: The subprogram handles all the error checking.

Breaking complex programs into subprograms makes code easier to write, test, and maintain.

code

subroutine

Packaged callable code segment

routine · method · call · return · parameter · argument · variable · loop · conditional · recursion

execution

runtime

Program execution duration

sequencing · termination · exit · jump · goto · interrupt · thread · process · allocation · registers

modular

component

Element of a system

  • unitIndividual part or measure
  • blockSolid mass, or impede
  • segmentDistinct part of whole

partition · encapsulation · reusable · plug-in · interface · abstraction · decoupling · hierarchy · structured · interchangeable

Opposites
hierarchical position in code structure

subprogramsmain function

Chief operational role

entry point · supervisor

Family

subprogram

Familiarity
Top 500,000
Profile
Used worldwide · Timeless · Rated G