Thorbjørn Ravn Andersen wrote:
Geir Magnusson Jr wrote:

  if ( A || B ) {
     engineReset();
     throw new DigestException( A ?
                "offset incorrect  = " + offset
                : "incorrect len value ");
}

Please :)  That much trouble to avoid writing engineReset() twice?

if (A) {
 resetEngine();
 throw new DigestException("offset incorrect " + offset);
}
if (B) {
 resetEngine();
 throw new DigestException("incorrect len value " + lenValue);
}

In my opinion ?: should only be used if there is a very good reason for it, as it lowers readability for future maintainers.



heh - I wasn't avoiding engineReset() - just really demonstrating that we should have an error message w/ data in it... :)

geir

Reply via email to