C
Collin VanDyck
ronron said:I tried to search the usenet for the same question...
Well I would like to know which is the coding style that you prefer
boolean booleanValue=getABooleanValue();
if (!booleanValue) {
doSomething();
}
Or
boolean booleanValue=getABooleanValue();
if (booleanValue == false) {
doSomething();
}
Chirping in once more to say that I find the way that XSLT will allow
one to negate a boolean to be the most readable:
<xsl:if test="not($var='true')">
</xsl:if>
It would be nice if you could extend the JLS with macros, or some sort
of pre-processor that would let you use:
if (not(isValidXMLDocument))
{
throw new Exception("WHAT");
}
which would translate into:
if (!isValidXMLDocument)
{
throw new Exception("WHAT");
}
Collin