Re: SAG-FO-01: Too many functions (general comment)

> From
http://lists.w3.org/Archives/Public/public-qt-comments/2003Jun/0082.html
>
> A11. fn:node-kind()
> 
> It is easy to test the kind of a node using "instance of" (or "type
switch"
> in XQuery)


> From
http://lists.w3.org/Archives/Public/public-qt-comments/2003Jun/0111.html
>
> http://lists.w3.org/Archives/Public/public-qt-comments/2003Jun/0082.html
> "It also affects the cost of learning to use the language, which is 
> another important predictor of success."
>
> I very much support this requirement. Is
> 
>    for $i in 1 to count($s) return
>      if ($s[$i] eq $v) then $i else ()
> 
> easier to learn than
> 
>    index-of()
> 
> ? Not at all IMHO; it's much more difficult to learn.


Consistency is also a factor for the cost of learning.
An example:
First we have a data model specifying a node-kind accessor
(http://www.w3.org/TR/xpath-datamodel/#dm-node-kind), but then the
corresponding accessor function is missing!? IMHO it's harder to learn
something expected is not available, then a larger, but consistent model of
a language.
BTW: I can see the argument with "instance-of" for testing, but what's about
the information itself? What if I'd like to use the node-type information
within my content? eg. in XSLT <xsl:value-of select="node-kind()"/> or
something alike? the alternatives like a big choice or a template matching
mode seem to me pretty heavy and probably inefficient.

Gruss,
Bruno Feurer

Received on Friday, 3 March 2006 15:07:08 UTC