You will want to use the second.
Both do the same ... compare A with B or compare B with A - both mean the same thing.
It just makes sense to use x != null , because it is more like the way we say it.
You can ask me: "Is x not null?" This seems more natural than "Is null not x?" It makes more sense to us.
source share