You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Antonio Gallardo <ag...@agssa.net> on 2004/03/04 11:47:09 UTC

Re: cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/binding RepeaterJXPathBinding.java

Sylvain Wallez dijo:
> Antonio Gallardo wrote:
>
>>joerg@apache.org dijo:
>>
>>
>>>joerg       2004/03/03 11:47:35
>>>
>>>  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/binding
>>>                        RepeaterJXPathBinding.java
>>>  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

areNullAllListElements()

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.