サブルーチン
解説 Definition
subroutine は、特定の処理をまとめ、プログラムの別の部分から呼び出して再利用できる処理単位、つまりサブルーチンです。プログラミング言語によっては、手続きや関数として説明されます。
A named, reusable section of a computer program that performs a particular task and can be called from another part of the program. Depending on the programming language, it may also be described as a procedure or function.
使い方 Usage
覚え方のコツ Memory Tip
sub-「下位の・補助の」+ routine「決まった手順」。繰り返す処理を一か所にまとめ、必要なときに呼び出す小さな処理単位を思い浮かべましょう。
Break the word into sub-, meaning secondary or subordinate, and routine, a regular sequence of actions. Picture repeated instructions collected in one small unit that can be called whenever needed.
例文
The program calls a subroutine to check the user's password.
そのプログラムは、ユーザーのパスワードを確認するためにサブルーチンを呼び出します。
She wrote a small subroutine for printing the monthly report.
彼女は月次報告書を印刷するための小さなサブルーチンを書きました。
Moving the repeated code into a subroutine made the script easier to maintain.
繰り返し使うコードをサブルーチンに移したことで、そのスクリプトは保守しやすくなりました。
subroutine の類義語・関連語
subroutine の語源・成り立ち Etymology
ラテン語 sub(下に)と routina(決まった道筋)の合成語。routine はフランス語 route(道)から派生し、「主経路の下位にある手順」が原義。関連語:subroutine → routine, suburb(都市の下=郊外)。プログラミングで繰り返し呼び出す小さな処理単位を指すのは、主処理の「下請け」という比喩から。
Subroutine was formed in English from the prefix sub-, “subordinate” or “secondary,” and routine, a fixed sequence of operations. Routine ultimately comes through French from route, “road” or “course.” The computing term developed for a subsidiary sequence of instructions that a larger program can call to perform a defined task. Its formation is therefore transparent within modern technical English rather than a direct Latin compound.
同じレベルの語彙をもっと
外部辞書で調べる
この英単語をクイズで覚えよう