We had a two-hour discussion on this the other day! (though we watched a movie in between :D) It makes sense in C and C++. It also makes sense to people for whom C and C++ makes sense.

The main arguments we found for using or not using

null == blah
0 == blah
MY_CONSTANT == blah

in java:

1)   it is common practice in C/C++
2)   it is not common practice in C/C++
3)   it is common practice in java
4)   it is not common practice in java
5)   it makes code verification easier in an editor (for example, if you
     use an editor made for C++ it might find the '=' error in the
     null = blah setup, and not the other way around)
6)   the meaning of what you are doing is more clear, since you
     are testing whether a constant is the thing you just found
7)   the meaning of what you are doing is less clear, since you
     are testing whether an object equals a constant and not the
     other way around
8)   it is not common practice in textbooks (for some reason, we
     couldn't think of a textbook that does it this way; though
     I'm sure there must be)

1-4 are really the most important argument (any way you put it, it makes life easier if we are all used to the same thing :D), but no-one bothered checking. In the end we found that null == blah became more plausible with the amount of beer consumed, so I say we keep doing it in avalon :D

cheers!

- Leo

Johan Sj�berg wrote:
Berin Loritsch wrote:
Jeff Turner wrote:



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



Reply via email to