🔗 Yoda conditions

🔗 Computing 🔗 Computing/Software 🔗 Star Wars

In programming jargon, Yoda conditions (also called Yoda notation) is a programming style where the two parts of an expression are reversed from the typical order in a conditional statement. A Yoda condition places the constant portion of the expression on the left side of the conditional statement. The name for this programming style is derived from the Star Wars character named Yoda, who speaks English with a non-standard syntax.

Yoda conditions are part of the Symfony, and the WordPress coding standards.

Discussed on