Wiktionary英語版

出典:Wiktionary

Yoda condition

出典:『Wiktionary』 (2026/02/20 20:06 UTC )

WOTD – 4 May 2024

発音

名詞

Yoda condition (plural Yoda conditions)

Example

The condition if (18 == age) is a Yoda condition, as the usual order of operands would be if (age == 18).

  1. (programming, informal) A logical condition with the usual order of operands reversed for various reasons, such as avoiding the accidental misuse of = (assignment) instead of == (equality), an error that is harder to spot when using the normal order of operands. [from early 21st c.]
    Synonym: Yoda notation

関連する語

参考

参照

  1. ^ From Star Wars: Episode IIAttack of the Clones (2002): see “The StarWars.com 10: Best Yoda Quotes”, in Starwars.com‎, San Francisco, Calif.: Lucasfilm, 26 November 2013, archived from the original on 3 April 2024.
  2. ^ zneak [pseudonym; Félix Cloutier] (12 March 2010), “Weirdest Occurrence Ever, UIButton @selector Detecting Right Button, Doing Wrong ‘Else_if’?”, in Stack Overflow‎, archived from the original on 28 August 2023:We should call that comparison styleYoda Conditions’.
  3. ^ Thomas M. Tuerke (17 July 2006), “Terminology”, in Thomas.Tuerke.net‎, archived from the original on 20 August 2008:Yoda Notation: the reversal of order, in particular in respect to operands of an equality operation in C and C++, []; Thomas M. Tuerke (17 April 2013), “Yoda Notation (aka Yoda Condition)—Origin of the Term”, in Thomas.Tuerke.net‎, archived from the original on 30 January 2024

Further reading

調べた例文を記録して、効率よく覚えましょう
Weblio会員無料で登録できます
履歴機能 過去に調べた単語を確認できる
語彙力診断 診断回数が4回に増加
マイ単語帳 便利な学習機能付き
マイ例文帳 文章で意味を理解できる

yoda conditionのページの著作権