実際にどう使われますか?
下の例文を通して、それぞれの単語がどのような状況で使われるのか学んでみましょう!
iteration
例文
The program uses iteration to calculate the sum of all the numbers in the list. [iteration: noun]
プログラムは反復を使用して、リスト内のすべての数値の合計を計算します。[反復: 名詞]
例文
We need to iterate through each element in the array to find the maximum value. [iterate: verb]
最大値を見つけるには、配列内の各要素を反復処理する必要があります。[反復: 動詞]
loop
例文
The program uses a loop to print out all the even numbers in the list. [loop: noun]
プログラムはループを使用して、リスト内のすべての偶数を出力します。[ループ:名詞]
例文
We need to loop through the array to find the index of the target element. [loop: verb]
配列をループして、ターゲット要素のインデックスを見つける必要があります。[ループ:動詞]
追加で知っておくといいこと
どっちの方がよく使われますか?
Loopは、プログラミングのコンテキストでiterationよりも一般的に使用されます。ただし、iterationは、数学やビジネスなど、プログラミング以外で使用できるより一般的な用語です。
どっちの方がよりフォーマルですか?
iterationとloopはどちらも、技術的な文脈、特にプログラミングとコンピュータサイエンスで使用される正式な用語です。