Hacker News new | ask | show | jobs
by radicalbyte 4570 days ago
This is why every developer should read Code Complete - it contains a myriad of tips learnt through many years of hard work.

Suffice to say that it contains such tips as avoiding negation in conditionals.

In the end it boils down to strategic optimization towards readability with the least mental overhead (the cycles you spend parsing, the more you can spend thinking).

1 comments

As weird as it sounds, "or" ends up being kind of evil, and something to avoid, as well. Mix it with "and", and the result likely doesn't say what your tired brain thought it did. Also, how many "or" statements have you seen that should really be set membership tests? (it helps to have a language that makes it easy to make a literal of a set)