サブルーチン
「サブルーチン」の英語
「サブルーチン」は英語で subroutine と言います。繰り返し使う処理のまとまりを指し、プログラミング言語によっては、値を返す関数と区別されます。技術文書やコードの説明でそのまま使える基本語です。
「サブルーチン」の英語の使い分け
特定の処理をまとめ、プログラムから何度も呼び出す技術用語です。
命令のまとまりを表し、言語によっては値を返さない手続きを指します。
入力に応じて値を返す処理を指し、意味が限定的な場合があります。
コアイメージ
プログラムから呼び出される、特定の処理を行う再利用可能なコードのまとまり
英英
A self-contained sequence of program instructions that performs a specific task and can be invoked from different places within a program.
語源
subroutineは、接頭辞sub-(下位)とroutine(定型の手順)が合わさり、補助的な処理を行う手続きという意味で用いられる。
コラム
- サブルーチンは繰り返し使う処理をまとめたもので、言語によっては値を返すfunction(関数)と区別されることがある。
「サブルーチン」のレベル別の例文
- 中学
This small subroutine checks each user's password for errors.
- 高校・英検2級
The system uses a subroutine to calculate tax on every transaction.
- TOEIC・ビジネス
The development team created a subroutine to reduce repeated database queries.
- 日常会話
Just call the subroutine again if the screen freezes.
「サブルーチン」を英語にするときのよくある間違い
× The program does a subroutine.
○ The program calls a subroutine.
サブルーチンは do するものではなく、通常 call で呼び出します。