tags:

views:

15

answers:

2

For example, I can have a code like:

<logic:equal name="userForm" property="isRishi" value="YES">
  Welcome, your name is Rishi</logic:equal>

And another code like this:

<logic:notEqual name="userForm" property="isRishi" value="NO">
  Welcome, your name is Rishi</logic:notEqual>

Both would function the same. So what difference is there in using these two tags?

+1  A: 

If there are only two possible values, the only difference is that the second form is harder to understand due to the double negation.

If isRishi can have values other than "YES" and "NO" (e.g. null) then the difference should be obvious.

Michael Borgwardt
A: 

They exist for better readability. notEqual to no is convoluted and harder to grasp.

And also, for the same reason why the ! operator exists.

Bozho