Follow

That thing where you find multiple boolean flags that seem to be redundant, but the logic is so twisted you have to beg for help from the original authors.

When multiple flags I consider redundand (or inelegant) are used in the same IF clause, I use De Morgan's laws to rearrange them and get a different perspective on the problem. It's a very simple step compared to debugging the values and oftentimes visualizes a more elegant solution for me.

en.wikipedia.org/wiki/De_Morga

Sign in to participate in the conversation
Mastodon

Generalistic and moderated instance. All opinions are welcome, but hate speeches are prohibited. Users who don't respect rules will be silenced or suspended, depending on the violation severity.