3 ms·
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.
by canacrypto 7y ago
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.
- thomasahle 7y agoAre 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.
- jonny_eh 7y ago> so it makes sense to put the important information Both sides of the equality check are equally important.
- TheSoftwareGuy 7y agoI 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