xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett McLaughlin <brett.mclaugh...@lutris.com>
Subject Re: [Xerces2] Coding Conventions (warning: controversial!)
Date Tue, 10 Oct 2000 16:48:32 GMT


Arnaud Le Hors wrote:
> 
> Jeff Larson wrote:
> >
> > While we're on the subject of style, I'd like to point out something
> > that we find far more offensive than naming conventions.
> >
> > Please, please, please do not use exceptions as part of "normal" control
> > flow.
> >
> > We're using 1.0.3, so forgive me if this has been fixed in later versions.
> > We'll be upgrading soon, and if this flaw is still present in the latest
> > release, we'll be fixing it locally.  I'll be happy to make the source
> > changes available.
> 
> We do not have any such plans for now, but I'd be very interested to get
> your changes and see how it impacts performances. The reason it is the
> way it is is for performances only. I don't like that style of
> programming myself either. I think exceptions should be kept for
> exceptional circumstances. And hitting the end is definitely not
> exceptional when iterating over an array. It *always* happens!
> But a friend of mine, who used to work at Sun on JVMs, confirmed to me
> that this is much more efficient than having a test. So, I think it's
> one of the areas where we have to be pragmatic and see what the best
> trade-off is. Note that I'm not saying that's what's in Xerces now! Just
> that it needs to be decided after study.
> In particular, I'm interested to see if Hotspot does any better with
> your changes. It fails miserably on the current code...

I've heard the same about the ArrayOutOfBoundsException being better for
catching array ends, and have used that myself. I have not heard
anything about efficieny of NullPointerExceptions being caught though;
have you, Arnaud? I'm curious - performance is always tricky ;-)

Perhaps we end up with a hybrid; the ArrayOutOfBoundsException seems
reasonable, as it adds performance, but is also not something someone
will be keying on in debugging (at least not often); but the
NullPointerExceptions might be something we can take out and not suffer,
or suffer minimally. Anyone know off the top of their head what those
are used for (the nulls, not the array one).

-Brett

> --
> Arnaud  Le Hors - IBM Cupertino, XML Technology Group
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org

-- 
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 
http://www.lutris.com
http://www.enhydra.org

Mime
View raw message