[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: The subsetting has begun


delphi sax terminate reading
I don't know why we argue about this being a good practice in Java.
Although it is an integral part of serious error handling, even in
J2SDK1.4, exception paths are about 3 orders of magnitude slower than
return values (I just retested this to make sure its an accurate
statement for recent VMs). So as a regular course of processing
exceptions are *not* the right solution for most applications.

> > Karl Waclawek scripsit:
> >
> > > I agree. It would be nice, however, if SAX for instance allowed
> > > an application to stop parsing (based on an event) without
> > > having to throw an exception.
> >
> > What's wrong with exceptions?  This kind of thing, abandoning an
action,
> > is what they were made for.
> 
> Maybe that is different for Java, but in general this is simply wrong.
> Program flow should not be controlled with exceptions.
> Apart from that they are expensive in most languages.
> 
> And you have to trap them in your app, since you might not actually
want
> to
> terminate the routine where the parse call returns to.
> 
> In addition, low level code should return a status and leave the
decision
> whether an exception should be thrown to the higher level code that
> has sufficient context to make it.
> 
> > If one of your SAX handlers decides that
> > there is no point in reading further, create an AllDoneException
> packaged
> > inside a SAXException, and away we go.
> 
> Well, we (a group of programmers) ported SAX2 to Delphi.
> On Delphi the idea of using exceptions for regular program flow
control
> is just not right. Same in C++.
> 
> And like C++, Delphi is sometimes used for speed, meaning that
> one takes care about memory allocations. Exceptions are too
> expensive from that point of view, which matters if the program
> is meant to continue, and matters less if the current context has to
> be terminated.
> 
> Karl
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.