> Rog�rio Meneguelli Gatto wrote:
>
> Carlos Amengual wrote:
> >
> [snip]
> > OTOH it is generally bad to use exceptions as substitute for conditional
> > blocks, IMO.
> [snip]
>
> I've heard (or read, don't know) that the exception strategy has some
> performance advantage. Both exception logic and null pointer checking
> are always there, so if you use 'if', it's (kind of) redundant.
Every exception in Java causes the VM to build a complete stack trace for
that exception, which can be very time consuming compared with simply
checking if the value is null or not. It's generally better practice to
have the normal program flow using if, while, for, break, etc instead
of relying on exceptions, which should be saved for exceptional (i.e. rare)
or error conditions.
--John
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html