java - Using double negatives to test for conditions -
To validate user input, I do not know which of the two options is better
< H1> 1 pre << >> <<> east <<< >> <<> <<> <<> Noble (object input)
2
non (object input)
Apache's Commons Lang Library chose # 2 but I was uncomfortable with double negative I am what do you say?
For me, double negativity is always a bad thing, I would say it is soft to stick. When reading futility, it is understandable in reading. Unlike it (! IsNull (o)) // ...
who reads "If not, then zero" is sure that it Feeling slow is read aloud, but with this option # 1, it is more understandable than examining futility.
if (! IsNotNull (o)) // ...
A statement that makes you reverse and says "Hey wait a minute ... if not ... ".
But If there is a standard already in the names of the method, then paste it is standard good work, and should not be broken just because someone " Uncomfortable ".
Comments
Post a Comment