Subject: Re: [xsl] I love programs that output programs From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sun, 19 Jan 2025 12:36:57 -0000 |
Hi Folks, Readability is a fascinating subject. I am reading the book titled, The Prize, the Epic Quest for Oil, Money & Power by Daniel Yergin. Here is a passage from the book (p. 91): bThe congressman had a bright idea. A presidential author might certainly be subject to flattery, especially one who had proved as prolific as Roosevelt. He would apprise Roosevelt of Archboldbs admiration and use that gambit to arrange a meeting.b Yergin has an impressive vocabularybfar larger than my own. I highlighted the words that I was unfamiliar with. The passage was unreadable to me. After I looked up those words in a dictionary, the passage was readable. A few days ago Dimitre remarked that the below XSLT code is unreadable. I learned the technique used in that code by reading the XSLT code for the Schematron processor. I have used the technique countless times over the years. For me, the code is readable. Is there an objective definition of readability? Is it possible to write codebor English passagesbthat is readable to everyone? I am fascinated by the nexus between writing readable English passages and writing readable code. Does the skill of writing good English carry over to the skill of writing good code? Does the skill of writing good code carry over to the skill of writing good English? If onebs mind is clear, logical, and organized, can one write readable English and readable code? <xsl:template match="/"> <axsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"> <axsl:template match="/"> <axsl:for-each select="/passwds/passwd"> <axsl:variable name="passwd" select="."/> <xsl:for-each select="/validation_tests/test"> <axsl:choose> <axsl:when test="{xpath}"> <axsl:message>line <axsl:value-of select="position()"/>, <xsl:value-of select="message"/>: <axsl:value-of select="$passwd"/></axsl:message> </axsl:when> </axsl:choose> </xsl:for-each> </axsl:for-each> </axsl:template> </axsl:stylesheet> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] I love programs that outp, Dimitre Novatchev dn | Thread | Re: [xsl] I love programs that outp, Dimitre Novatchev dn |
Re: [xsl] I love programs that outp, Anthony J (Tony) Buf | Date | Re: [xsl] Running XSLT from Python, Wendell Piez wapiez@ |
Month |