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

Re: The subsetting has begun

delphi 2006 xml editor

> 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.



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.
First Name
Last Name
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.