Learn in the textbookCoding Conventions and Structuring
DefinitionA subroutine (サブルーチン) is a part that packs a specific block of processing into one unit so that other processing can call it.
ExplanationWhen called, it carries out its processing and then returns to where the caller left off. The same code need not be written in several places, and one fix applies everywhere it is called. Depending on the language it is also called a function or procedure, and a subroutine can itself call other subroutines.
AnalogyIt is like a recipe that says "for making stock, see the separate page", which you can turn to whenever that step comes up.
Memory hookSub is a prefix meaning below or subordinate, the same sub as in submarine, a ship that travels below the surface.