subroutine

Học thuật
Thân thiện
subroutine

The programmer calls a subroutine to calculate the total.

Definition
  1. Noun:
    • A set sequence of steps, part of a larger computer program: A subroutine is a self-contained block of code within a larger program that performs a specific, well-defined task. It is designed to be called or invoked from other parts of the program, often multiple times, to promote code reusability and organization.
Usage Examples
  • Noun:
    • The programmer wrote a subroutine to calculate the average of a list of numbers.
    • To sort the data, the main function calls a dedicated sorting subroutine.
    • Debugging is easier when complex tasks are broken down into separate subroutines.
Advanced Usage
  • "To call a subroutine": To execute the code within a subroutine from another part of the program.

    • The main algorithm calls the validation subroutine before processing the input.
  • "To define a subroutine": To write and name the block of code that constitutes the subroutine.

    • She defined a new subroutine to handle user authentication.
Variants and Related Words
  • Subprogram (n): Another term for subroutine.

    • Functions and procedures are types of subprograms.
  • Function (n): A type of subroutine that typically returns a value.

  • Procedure (n): A type of subroutine that performs an operation but may not return a value.
  • Method (n): In object-oriented programming, a subroutine associated with an object or class.
Synonyms
  • Module: A separable component, often interchangeable with subroutine in modular programming.
  • Routine: A general term for a sequence of instructions performing a task.
Related Phrases
  • Library routine: A pre-written subroutine stored in a library for common use.

    • The software uses a library subroutine for advanced mathematical operations.
  • Recursive subroutine: A subroutine that calls itself as part of its operation.

    • The factorial calculation was implemented as a recursive subroutine.
subroutine

The programmer calls a subroutine to calculate the total.

Noun
  1. a set sequence of steps, part of larger computer program

Từ chứa "subroutine"

Từ có nhắc đến "subroutine"