cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <>
Subject Re: cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding
Date Thu, 04 Mar 2004 10:47:09 GMT
Sylvain Wallez dijo:
> Antonio Gallardo wrote:
>> dijo:
>>>joerg       2004/03/03 11:47:35
>>>  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/binding
>>>  Log:
>>>  clean up: removed unused code (for reverting changes we have CVS, so
>>>please remove old stuff always), JavaDoc added, comments fixed;
>>>  changed isNullAllListElements() => isAnyListElementNotNull(): the
>>>duplicate negation at usage time breaks my brain ;-)
>>This depends of the POV you see it:
>>isNullAllListElements() -> This is not a negation. It check if :
>>All elements on the List are null. Where is the negation?
>>isAnyListElementNotNull() -> Here is a negation "Not null"  :-D
> Generally speaking, negative forms should be avoided, as their
> interpretation may be difficult depending on people's linguistic
> background. I used to work with Japanese people long time ago, and I'm
> sure this name, even with a single negation, would be very hard for them
> to understand.

I agree.
> So what about "hasNonNullElements()"?

The problem again is the "hidden" Non. This is a kind of negative.

Look as the "standard" isNull() function. Why it is not isNotNull()?
Because there is a negation.

Then, the original function name is better to me:

isNullAllListElements() or


To me it clearly states what we had in mind.

Goerg changed the function name (and behavior) to write:

if (isAnyListElementNotNull(...))

instead of

if (!isNullAllListElements(...))

As a rule I try to avoid negation inside the names.

In the case hasNonNullElements(), we can write also:

if (hasNonNullElements())

Interesting is that  the method need to check for each element if the
value is null.

At the end, I think I am not the best to decide the best name of the
function. :-D

Best Regards,

Antonio Gallardo.

View raw message