For me that partially means how many milliseconds it takes your brain to figure out there is negation there.
Copy code
if (not isEmpty())
if (!isEmpty())
if (isNotEmpty())
if (isEmpty().not())
n
nounours
04/20/2017, 10:25 AM
first is cool, but takes longer to type. Is it sensible? I don't know.
Second is the mainstream version, it does the job.
Third is a BAD idea. you'll return true on a negation, it's a mess for a human brain
Fourth is like a hipster. It exists, but why should we be like it ?
s
sksk
04/21/2017, 7:01 AM
i personally prefer the 2nd
sksk
04/21/2017, 7:02 AM
maybe because i'm used to it
sksk
04/21/2017, 7:02 AM
1st one is easier to read at first sight
m
mg6maciej
04/21/2017, 7:48 AM
We all are used to 2nd. Local optimum. Just like it felt really unproductive for a week for so when I was switching from Eclipse to Android Studio when it was version 0.2 or something.