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

Re: It is okay for things to break in the future!

  • From: Michael Kay <mike@saxonica.com>
  • To: Norman Gray <norman.gray@glasgow.ac.uk>
  • Date: Tue, 6 Sep 2022 11:22:31 +0100

Re:  It is okay for things to break in the future!
> 
> But if there is a bit in your code where there is effectively a queue (I'm struggling to find a good concrete example here), you might decide to implement the queue insertion with what is effectively a O(N^2) algorithm, because it's bulletproof, and N is never going to be more than a few.  The argument is saying 'Go ahead and do that -- don't beat yourself up -- _but_ it would be wise to think briefly about how big N can be, and wise to fix N, and to ensure the program deliberately fails with 'rewrite me!' when that limit is breached.'
> 

There are certainly cases where I decide to to assume that the number of attributes or in-scope namespaces on an element will usually be small enough that a quadratic algorithm is OK. But I certainly wouldn't use that as justification for putting an arbitrary limit of (say) 16 on how many attributes or namespaces you can have.

On the other hand, you do sometimes need to impose limits, e.g. a limit of 65536 on the number of distinct namespace URIs in a document. If you've decided that there are good engineering reasons for imposing such a limit, then fine, you need to fail cleanly if they are exceeded, and if that's done using schema validation, that's fine too. But that's a very different matter from imposing a limit of 16 because that's the most we've ever seen or the most we can imagine anyone wanting. 

Michael Kay
Saxonica



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.