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

Re: RE: Declarative programming requires a different mindset

  • From: David <dlee@calldei.com>
  • To: xml-dev@lists.xml.org
  • Date: Wed, 17 Mar 2010 08:17:51 -0400

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!

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.