The plan is to just follow the standard Java coding conventions. I don't recall if they mention this specific situation, but personally I prefer to see the variable name first because it's easier to read. The only time I've ever seen a reversal like that is when doing something like ...

if("".equals(variable))

this is useful if you don't want to exlicitly check that "variable" is non-null before trying to use the .equals() method.

-- Allen


Henri Yandell wrote:

Generally I ignore coding style and just match the style of the file
I'm editing, or the package I'm adding a class to etc. I noticed one
bit that isn't usually done in Java, usually it's
a C habit I think:

if ( null != mVariable )

instead of:

if ( mVariable != null )

Is this a contentious one, or something to easily fix as and when it's seen?

Hen

Reply via email to