java - Why is there always isEmpty whereas I use !isEmpty 99% of the time -
this question has bogged me quite while. during programming there regularly question whether there in object or not. reason isempty method invented. great, in practice use !isempty time.
as consequence, notempty more appreciated addition language java. question is: why don't language designers think of before defining api? @ least give counterpart isempty
edit: meant there should notempty isempty. depending on domain, both of them may used in cases when ui not involved, think notempty applies better.
edit2: close discussion, here example:
!metadata.isempty() == metadata.notempty() i'd prefer had right side of equation well.
isempty follows naming convention of other syntactically positive isxxx methods such isvisible , isenabled
Comments
Post a Comment