Berin Loritsch wrote:
Jeff Turner wrote:

So is there any other reason for this? Can I do a massive grep for 'null !=' and change these?


No, I think that is the major reason.

I remember a discussion between Peter D. and someone here on the list about this. I can't find it in the web archive so I include it from my local history. It might not be interesting though.


<INCLUDED-MESSAGE>

At 08:24 1/12/00 -0500, you wrote:

>Just a stylistic nit-pick:
>
>I noticed you committed a change that does nothing
>but change the style of the code.  Let me explain
>why I do it the way I do.
>
>regarding "if (null != message) ...":
>
>to me this is not semantically correct, it is kind
>of backwards.  We are not checking if null is
>message, but if message is null.  I also think that
>by keeping it "if (message != null) ..." it is more
>readable and understandable by most English speaking
>folks.


I used to agree .. thou apparently we are wrong ;) (Had an argument with a professor over this one time ;] ) The reason basically comes down to
expectations. "if( XXX == ... )" where XXX is any immutable-constant (like integer values, floats, nulls) is meant to facilitate understanding. It helps you understand the difference between "constants" and l-vars (or whatever they are called). Students who were taught "if( XXX == ... )" gain a "deeper" understanding of programming language. In some languages (namely c/c++) it also has added benefit of using compiler to check you don't have single '=' etc - thou this is for all purposes not relevent to java.


<SNIP/>

Cheers,

Pete

</INCLUDED-MESSAGE>

Perhaps there is something to that, but ( null == arg ) still twists my head after some time spent on reading Avalon code ;)

Cheers,

//
Johan


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to