<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Filtering versus conditional logic</title>
	<atom:link href="http://rc3.org/2008/10/14/filtering-versus-conditional-logic/feed/" rel="self" type="application/rss+xml" />
	<link>http://rc3.org/2008/10/14/filtering-versus-conditional-logic/</link>
	<description>Rafe Colburn on software development (and other topics)</description>
	<lastBuildDate>Mon, 21 May 2012 23:52:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: http://rcrowley.org/</title>
		<link>http://rc3.org/2008/10/14/filtering-versus-conditional-logic/comment-page-1/#comment-3149</link>
		<dc:creator>http://rcrowley.org/</dc:creator>
		<pubDate>Thu, 16 Oct 2008 01:18:26 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8597#comment-3149</guid>
		<description>&lt;p&gt;http://github.com/rcrowley/sometimes/tree/master&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><a href="http://github.com/rcrowley/sometimes/tree/master" rel="nofollow">http://github.com/rcrowley/sometimes/tree/master</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: http://rcrowley.org/</title>
		<link>http://rc3.org/2008/10/14/filtering-versus-conditional-logic/comment-page-1/#comment-3148</link>
		<dc:creator>http://rcrowley.org/</dc:creator>
		<pubDate>Thu, 16 Oct 2008 00:19:24 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8597#comment-3148</guid>
		<description>&lt;p&gt;Jacob: you raise many good points.  HTML as an output format is limiting.  I would generalize this to all serialization schemes.  Thinking on the server-side in terms of DOM nodes is a reasonable thing to do but again gets us caught up thinking about layout for anything complicated.&lt;/p&gt;

&lt;p&gt;I think a good templating system can make the bridge between data and layout fairly seamless.  The idea that HTML is only a serialization scheme can help by allowing us to manipulate the tree structure before it&#039;s written out.  Enough hand-waving.  Code soon.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Jacob: you raise many good points.  HTML as an output format is limiting.  I would generalize this to all serialization schemes.  Thinking on the server-side in terms of DOM nodes is a reasonable thing to do but again gets us caught up thinking about layout for anything complicated.</p>

<p>I think a good templating system can make the bridge between data and layout fairly seamless.  The idea that HTML is only a serialization scheme can help by allowing us to manipulate the tree structure before it&#8217;s written out.  Enough hand-waving.  Code soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Davies</title>
		<link>http://rc3.org/2008/10/14/filtering-versus-conditional-logic/comment-page-1/#comment-3147</link>
		<dc:creator>Jacob Davies</dc:creator>
		<pubDate>Wed, 15 Oct 2008 22:00:49 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8597#comment-3147</guid>
		<description>&lt;p&gt;One of the big problems in web development is this question of whether programs should emit data or should emit HTML. The whole programming model is built around emitting HTML, and pretending (using CSS) that it is really data. When really of course most of the time it&#039;s mostly layout.&lt;/p&gt;

&lt;p&gt;This is really a wholly unsolved mess of a problem. Template systems only go so far to solving it, because templates are not standardized and so tend to limit interoperability. And templates are only a partial solution to the whole data-versus-presentation problem - they still essentially say &quot;The output of this program is HTML&quot; even if there was an intermediate stage where it was a template + data.&lt;/p&gt;

&lt;p&gt;The only things that hold out any hope here are real data formats that are easy to use and efficient.  XML is one, but has proven to be pitifully slow and overcomplex. XML Schema made things worse, and completely screwed the pooch by including default values for elements (among other similar flaws), which means that validation is &lt;em&gt;required&lt;/em&gt; to get the correct form of the document.&lt;/p&gt;

&lt;p&gt;This is all bad.&lt;/p&gt;

&lt;p&gt;JSON is the only thing that is remotely workable, but doesn&#039;t have enough takeup yet. And even there it has problems, like that important datatypes like dates are not specified.&lt;/p&gt;

&lt;p&gt;To me this is a way-unsolved problem.  REST, XML, SOAP, JSON aren&#039;t enough. I think we need something on the level of the CGI or Servlet API that specifies a language-independent (and yet, unlike the DOM, native-tailored) web programming model that involves data flows and not layout.&lt;/p&gt;

&lt;p&gt;I&#039;m not holding my breath.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>One of the big problems in web development is this question of whether programs should emit data or should emit HTML. The whole programming model is built around emitting HTML, and pretending (using CSS) that it is really data. When really of course most of the time it&#8217;s mostly layout.</p>

<p>This is really a wholly unsolved mess of a problem. Template systems only go so far to solving it, because templates are not standardized and so tend to limit interoperability. And templates are only a partial solution to the whole data-versus-presentation problem &#8211; they still essentially say &#8220;The output of this program is HTML&#8221; even if there was an intermediate stage where it was a template + data.</p>

<p>The only things that hold out any hope here are real data formats that are easy to use and efficient.  XML is one, but has proven to be pitifully slow and overcomplex. XML Schema made things worse, and completely screwed the pooch by including default values for elements (among other similar flaws), which means that validation is <em>required</em> to get the correct form of the document.</p>

<p>This is all bad.</p>

<p>JSON is the only thing that is remotely workable, but doesn&#8217;t have enough takeup yet. And even there it has problems, like that important datatypes like dates are not specified.</p>

<p>To me this is a way-unsolved problem.  REST, XML, SOAP, JSON aren&#8217;t enough. I think we need something on the level of the CGI or Servlet API that specifies a language-independent (and yet, unlike the DOM, native-tailored) web programming model that involves data flows and not layout.</p>

<p>I&#8217;m not holding my breath.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: l.m.orchard</title>
		<link>http://rc3.org/2008/10/14/filtering-versus-conditional-logic/comment-page-1/#comment-3146</link>
		<dc:creator>l.m.orchard</dc:creator>
		<pubDate>Wed, 15 Oct 2008 12:48:56 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8597#comment-3146</guid>
		<description>&lt;p&gt;You could also tack on an XSLT filter at the end, if you&#039;ve been diligent enough to maintain absolutely valid XHTML all along the way.&lt;/p&gt;

&lt;p&gt;But, I&#039;d imagine it&#039;s not more common because, as Jacob said, you&#039;d need to buffer up all the output from previous stages and parse it before applying further transformative filters - which is something I&#039;d bet most frameworks don&#039;t have the forethought or facility to accomplish.&lt;/p&gt;

&lt;p&gt;Then again, some do - output buffering is pretty much dead simple in PHP, and I&#039;ve seen some scary things done with regexes at the tail-end of a request to wedge in anti-CSRF bits into forms and to tack on metrics JS includes.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You could also tack on an XSLT filter at the end, if you&#8217;ve been diligent enough to maintain absolutely valid XHTML all along the way.</p>

<p>But, I&#8217;d imagine it&#8217;s not more common because, as Jacob said, you&#8217;d need to buffer up all the output from previous stages and parse it before applying further transformative filters &#8211; which is something I&#8217;d bet most frameworks don&#8217;t have the forethought or facility to accomplish.</p>

<p>Then again, some do &#8211; output buffering is pretty much dead simple in PHP, and I&#8217;ve seen some scary things done with regexes at the tail-end of a request to wedge in anti-CSRF bits into forms and to tack on metrics JS includes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: http://rcrowley.org/</title>
		<link>http://rc3.org/2008/10/14/filtering-versus-conditional-logic/comment-page-1/#comment-3145</link>
		<dc:creator>http://rcrowley.org/</dc:creator>
		<pubDate>Wed, 15 Oct 2008 06:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8597#comment-3145</guid>
		<description>&lt;p&gt;I&#039;ve thought about something like this before, inspired slightly by _why&#039;s Markaby project.  The half-baked version goes like this: what if the eventually-emitted markup started out as a hash-of-hashes or a SimpleXML tree (or the like)?  Then your templating system is just appending nodes to the tree.  If the nodes in this tree are decorated with things like &lt;code&gt;needs_authentication = true&lt;/code&gt; then filtering as you describe can be applied during the hash-of-hashes to XHTML translation.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve thought about something like this before, inspired slightly by _why&#8217;s Markaby project.  The half-baked version goes like this: what if the eventually-emitted markup started out as a hash-of-hashes or a SimpleXML tree (or the like)?  Then your templating system is just appending nodes to the tree.  If the nodes in this tree are decorated with things like <code>needs_authentication = true</code> then filtering as you describe can be applied during the hash-of-hashes to XHTML translation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aristotle Pagaltzis</title>
		<link>http://rc3.org/2008/10/14/filtering-versus-conditional-logic/comment-page-1/#comment-3144</link>
		<dc:creator>Aristotle Pagaltzis</dc:creator>
		<pubDate>Wed, 15 Oct 2008 05:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8597#comment-3144</guid>
		<description>&lt;p&gt;In Genshi this is much nicer for single elements:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;a href=&quot;&quot; py:strip=&quot;not logged_in&quot;&gt;My stuff&lt;/a&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And also when you want to do it for many elements:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;span py:match=&quot;a&quot; py:content=&quot;node()&quot; py:strip=&quot;True&quot;/&gt;
&lt;/code&gt;&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>In Genshi this is much nicer for single elements:</p>

<pre><code>&lt;a href="" py:strip="not logged_in"&gt;My stuff&lt;/a&gt;
</code></pre>

<p>And also when you want to do it for many elements:</p>

<pre><code>&lt;span py:match="a" py:content="node()" py:strip="True"/&gt;
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Davies</title>
		<link>http://rc3.org/2008/10/14/filtering-versus-conditional-logic/comment-page-1/#comment-3143</link>
		<dc:creator>Jacob Davies</dc:creator>
		<pubDate>Wed, 15 Oct 2008 04:02:48 +0000</pubDate>
		<guid isPermaLink="false">http://rc3.org/?p=8597#comment-3143</guid>
		<description>&lt;p&gt;You&#039;d need to parse the output of your program and then re-emit it, which of course is possible, but probably slow. Unless of course your application happens to be emitting XML using the DOM framework and you can intercept that before it&#039;s turned to a string and written to the client.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You&#8217;d need to parse the output of your program and then re-emit it, which of course is possible, but probably slow. Unless of course your application happens to be emitting XML using the DOM framework and you can intercept that before it&#8217;s turned to a string and written to the client.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

