Re:Yoda conditions
by thomasahle on Thursday August 15, 2019 @10:01AM
(#20705254)
Are they really easier to read though? A lot of the time which variable being tested is obvious, so it makes sense to put the important information - the value - first.
[ Parent
| on HN ]
> so it makes sense to put the important information
Both sides of the equality check are equally important.
Re:Yoda conditions
by TheSoftwareGuy on Thursday August 15, 2019 @01:41PM
(#20707586)
I think he should have written "it makes sense to put the non-obvious information first" as it contrasts better with the first part of the sentence