On Fri, 7 Mar 2003, Berin Loritsch wrote:
> Jeff Turner wrote:
> > Hi,
> >
> > Quick question. Why do people put null checks backwards:
> >
> > if ( null != this.inputSource ) {
> >
> > IMHO it is harder to read than
> >
> > if ( this.inputSource != null ) {
> >
> > and means exactly the same thing.
Likewise, I've seen something like this in code... can't remember if it's
anywhere in Cocoon:
if ( "something".equals(stringToCompare) {
...
}
IMO it seems more straightforward and easier to read if it's:
if ( stringToCompare.equals("something") ) {
...
}
Is this just a matter of style as well? The first way seems goofy if you
ask me.
Tony