If statement ne demek?

If statement, Türkçede “if ifadesi”, “koşul ifadesi” ya da “koşullu deyim” anlamına gelir.

isimTemel terim

Yazılım İngilizcesi · Programlama Kavramları

Yalnızca bir koşul doğru olduğunda çalışan kod bloğu; çoğunlukla koşul yanlış olduğunda çalışan bir else kısmıyla birlikte kullanılır.

English: A piece of code that runs only when a condition is true, often followed by an else part that runs when the condition is false.

Nerede ve nasıl kullanılır?

'Conditional' ya da 'if-else statement' da denir. İncelemelerde 'nested if statements' (iç içe if'ler), 'this if is never true' veya 'replace this chain of ifs with a switch' gibi yorumlar duyulur. Çok kısa koşullar bazen ternary operatörle tek satırda yazılır. Türk ekiplerde genellikle 'if bloğu' ya da sadece 'if' denir.

Örnek cümleler

  1. Add an if statement to skip users who haven't verified their email.

    E-postasını doğrulamamış kullanıcıları atlamak için bir if ifadesi ekle.

  2. Three nested if statements make this function hard to follow.

    İç içe üç if ifadesi bu fonksiyonu takip etmeyi zorlaştırıyor.

Sık kullanılan kalıplar

  • nested if statements
  • if-else statement
  • add an if statement
  • if condition