subroutines

Beginner 💻 Tech / IT

Definition

Reusable chunks of code that perform specific tasks and can be summoned by the main program whenever needed, like having a personal assistant for your algorithm. Also known as functions or procedures, these are the building blocks that let programmers avoid copy-pasting the same code a hundred times. They take inputs, do their thing, and return outputs—ideally without causing your entire program to crash.

Example Usage

My program was 3,000 lines of spaghetti code until I broke it into subroutines and suddenly felt like a real engineer.

Source: Common programming terminology

Related Terms