Word info

Yoda condition

Noun

Meaning

Yoda condition (plural Yoda conditions)

(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.

Source: en.wiktionary.org

Related terms

Close letter words and terms