I really like doing this, but sometimes, when looking at the code really quick, in those languages that use the ! operator, I've found myself doing functions like isNotEmpty() so that I don't overlook the ! by mistake.
Kotlin's standard library has methods like isNotBlank() and isNotEmpty() as part of the String class that showcase this.
Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
I really like doing this, but sometimes, when looking at the code really quick, in those languages that use the
!
operator, I've found myself doing functions likeisNotEmpty()
so that I don't overlook the!
by mistake.Kotlin's standard library has methods like
isNotBlank()
andisNotEmpty()
as part of theString
class that showcase this.Ramda has a function called
complement
that can help you build these functions.