3 ms·
You and muricula's sibling comment is the reason I asked :) Occasionally it is hard to spot the "!" between "if" and "(", and having to figure out if it is an o
by rzzzt 6y ago
You and muricula's sibling comment is the reason I asked :) Occasionally it is hard to spot the "!" between "if" and "(", and having to figure out if it is an omission or it was deliberate. I was wondering if spelling it out as "foo == false" is worthwhile.
- HeyLaughingBoy 6y agoAt one job I had, our programming standards dictated that we would have to write "if (false == foo)" to account for the case where someone accidentally types = instead of ==
- zentiggr 6y agoThat's not rare, anyway... unless the linter can flag == <bool>, and suggest fixes.
- MauranKilom 6y agoCommonly called "Yoda conditions": https://en.wikipedia.org/wiki/Yoda_conditions https://en.wikipedia.org/wiki/Yoda_conditions