Re: [xsl] Is xsl:for-each "syntactic sugar"?

Subject: Re: [xsl] Is xsl:for-each "syntactic sugar"?
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Sat, 8 May 2010 07:50:10 +0530
thinking again about Roger's original question:

"for-each vs recursive functions"

I think, other than efficeincy reasons for selecting between these two
constructs, designer's select a construct because it's easier for them
to design a specific algorithm (and to realize the design, people
sometimes might go to extents like adding more memory or a faster
CPU).

Moreover, IMHO a code should be written, keeping in view that it will
be seen, and possibly maintained by other people. A recursive
implementation, for a recursive problem, is easily understood by
others!

IMHO, another point.. I generally wouldn't like to write a iterative
implementation (for efficiency benefits), if the computing resources I
have, could easily serve a recursive implementation for a recursive
problem.

To summarize the above thoughts,
efficiency concerns (space & time) and algorithm design, are 'traded
of' for different use-cases.

On Fri, May 7, 2010 at 4:32 AM, Costello, Roger L. <costello@xxxxxxxxx> wrote:
> Hi Folks,
>
> 1. Everything that can be done using xsl:for-each can be done using a recursive function. (True or False)
>
> 2. There are things that can be done using a recursive function that cannot be done using xsl:for-each. (True or False)
>
> 3. xsl:for-each is syntactic sugar. (True or False)
>
> 4. Favor recursive functions over xsl:for-each. (True or False)
>
> /Roger



-- 
Regards,
Mukul Gandhi

Current Thread