Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
That would depend on the original field i use. If the field first expected to be told something is invalid then ill use IsInvalid()
Though often i use negate positive since saying 'not InValid' feels clunky -
Shodan4987yThis might be a question for the philosophers, but I also prefer leaving the 'not' to the logical operator by default to avoid double negatives when reading.
-
kamar2747yIsValid, but we can do better! Validate on rulesets to avoid many if blocks for validation checking is far clearer IMHO. 😉
Related Rants
Do you prefer to negate a positive function or write a negative one?
Example
!IsValid() vs IsInvalid()
undefined
functions
debate