最終更新日 :2025/12/04

Yoda condition

名詞
くだけた表現
日本語の意味
プログラミングにおける論理条件を表現する手法の一つで、通常のオペランドの順序(例: if(age == 18))の代わりに、オペランドの順序を反転させた条件式(例: if(18 == age))を書く方法。これは、代入演算子(=)と等価演算子(==)の誤用を防ぐために利用される。
このボタンはなに?

偶然代入演算子(=)を使ってしまうのを避けるために、コードではオペランドの順序を逆にした条件を使いました。

plural

復習用の問題

(programming, informal) A logical condition with the usual order of operands reversed — e.g. if (18 == age) rather than if (age == 18) — for various reasons, such as avoiding accidental misuse of = (assignment) instead of == (equality), a mistake that is harder to spot when using the normal order of operands.

音声機能が動作しない場合はこちらをご確認ください
正解を見る

Yoda condition

I used a Yoda condition in the code to avoid accidentally using assignment instead of equality.

正解を見る

I used a Yoda condition in the code to avoid accidentally using assignment instead of equality.

音声機能が動作しない場合はこちらをご確認ください

英語 - 英語

項目の編集設定
  • 項目の編集権限を持つユーザー - すべてのユーザー
  • 項目の新規作成を審査する
  • 項目の編集を審査する
  • 項目の削除を審査する
  • 重複の恐れのある項目名の追加を審査する
  • 項目名の変更を審査する
  • 審査に対する投票権限を持つユーザー - 編集者
  • 決定に必要な投票数 - 1
例文の編集設定
  • 例文の編集権限を持つユーザー - すべてのユーザー
  • 例文の削除を審査する
  • 審査に対する投票権限を持つユーザー - 編集者
  • 決定に必要な投票数 - 1
問題の編集設定
  • 問題の編集権限を持つユーザー - すべてのユーザー
  • 審査に対する投票権限を持つユーザー - 編集者
  • 決定に必要な投票数 - 1
編集ガイドライン

ログイン / 新規登録

 

アプリをダウンロード!
DiQt

DiQt(ディクト)

無料

★★★★★★★★★★