Hacker News new | ask | show | jobs
by DrCatbox 5214 days ago
Its far easier to read if (!someBoolean) than if (someBoolean == false)

Ofcourse, your example probably applies to JavaScript since anything and everything can be a boolean, or not depending on the phase of the moon. In Java at least if not someBoolean is nice to read, and if (isGood) is nicer than if (isGood == true).

1 comments

I think this is a pretty subjective topic - you can't say that one way is easier to read than any other way (for anyone except yourself).

Some people prefer verbosity over brevity, just like some people prefer K&R braces to Allman, or CamelCase to underscoring.