What are they?

The Basics

A subroutines is a series of code that follow a set of instructions that can be recalled at any time, for example:

Routine - A lighthouse flashes every second and every hour, its horn blows.

Subroutine - If a ship is too close to land, then the horn blows.

Other Languages

In different programming languages, subroutines are known as:

- Functions

- Procedure - Routine

- Method - Subprogram

Big image

Above is a example

Above this is a flow chart which demonstrates a routine (see right) and a subroutine (see left). In this case, its a lighthouse and the subroutine is blowing a horn if a ship is near.