News for hackers. Stuff that matters.
Re:Yoda conditions by canacrypto on Thursday August 15, 2019 @07:56AM (#20704351)
I've found it's better to write normal conditions that are easier to read and leave it to your linter to catch unintended assignments.
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.
Re:Yoda conditions by jonny_eh on Thursday August 15, 2019 @01:29PM (#20707456)
> 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