[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE: Declarative programming requires a different mindset
> Question: When you create XSLT transforms or XQueries, how do you maintain a declarative mindset, and avoid slipping back into an imperative mindset? > > /Roger > > Unfortunately I haven't reached that stage yet. I wish I have, but I'd be lying. Instead when my Imperative mindset hits a brick wall and what I want to code simply is not expressible my brain starts to hurt, until I come up with another approach that is expressible. Learning a few "design patterns" has helped .. Such as "When I would use iteration, instead use recursion", "When I want to modify something, instead Use a function to create an intermediate element/sequence and query/filter on that". Thinking out loud, I'd definitely buy a book (RARE for me ..) that maps imperative design patterns to declarative patterns. I've been programming in XQuery for several years now and still find it frustrating to do what should be simple things. For the most part I believe its not because they are not simple in XQuery but because I am 30 years trained in imperative/procedural thinking and old dogs have a hard time with new tricks. ---- To change topics (yes I'm too lazy to write a new email ) ---- Your example with XQuery with Updates has me thinking. What is the intended use case for XQuery with Updates. My impression is that the intended use case is to modify an existing XML document 'in place'. That by running insert/delete/update statements the end result is intended to update a document. However your examples over the last week have all been query based ... or I think they are. That is ... perform a (read only) query on a document using update semantics. Is this an intended use case of XQuery with Updates ? If so I've been missing the boat ! -David -- ------------------------- David A. Lee dlee@calldei.com http://www.calldei.com http://www.xmlsh.org
[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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|