73 | | |
74 | | There are numerous other recommendations, and while some are mainly a matter of personal aesthetics and preference, others are suggested for review and adoption: |
75 | | * [wikipedia:Yoda_conditions Yoda conditions] (see [comment:ticket:11622:24]): |
76 | | * makes comparisons more obvious by putting the constant up-front |
77 | | * erroneous assignment ('=' instead of '==') can't slip through unnoticed |
78 | | Example of common style: |
79 | | {{{ |
80 | | not req.authname or req.authname == 'anonymous' |
81 | | }}} |
82 | | The same example in 'Yoda condition' style: |
83 | | {{{ |
84 | | not req.authname or 'anonymous' == req.authname |
85 | | }}} |