
Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
On Fri, 17 Feb 2006 06:19:39 GMT, Roedy Green
<my_email_is_posted_on_my_website@munged.invalid> wrote, quoted or
indirectly quoted someone who said :
>String s = ( ba != null ) ? new String(ba) : null;
As an assembler coder, I got in the habit of putting the common case
first since fall through to the true case is faster than the jump to
the else.
This is also a nice documentation aid. When reviewing code you for
algorithm understanding you can temporarily ignore the elses and odd
case exception handling.
other people might write that as:
String s = ( ba == null ) ? null : new String(ba);
because == seems more natural to them than !=

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.