Hone

Color, word strength

subroutine

A set of instructions inside a program that other code can call by name. It runs, then hands control back to the point where it was called.

Tell

code called, run, then returned from

Best when

You mean a callable, reusable piece of code in general, without saying whether it returns a value, belongs to an object or is triggered by an event.

Example

“The loop calls a subroutine to validate each entry.”

Branches

a block of code called by name

hands back a result

  • function purpose, working, event or mapping

carries out steps only

  • procedure the set steps for one task, in order

attached to an object or class

  • method a planned way of getting it done

any fixed reusable block

  • routine a fixed sequence done again and again

a self-contained part of a program

called when something happens

  • callback returns to an earlier moment
  • handler deals with whatever it is given

suspends or expands instead of returning

  • coroutine can pause and resume midway
  • macro one command that expands into many

doing a small job for other code

a piece of a larger job outside code