Is it really a good practice to avoid using NOT operator in IF conditions in order to make your code better readable? I heard the if (doSomething()) is better t
if (doSomething())
I never heard of this one before.
How is
if (doSomething()) { } else { // blah }
better than
if (!doSomething()) { // blah }
The later is more clear and concise.
Besides the ! operator can appear in complex conditions such as (!a || b). How do you avoid it then?
Use the ! operator when you need.