<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: On Beauty in Code</title>
	<link>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/</link>
	<description></description>
	<pubDate>Sat, 19 Jul 2008 20:26:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Kabari</title>
		<link>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/#comment-66</link>
		<dc:creator>Kabari</dc:creator>
		<pubDate>Mon, 19 May 2008 00:40:36 +0000</pubDate>
		<guid>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/#comment-66</guid>
		<description>@PIERS and @RONNY the article isn't about the functionality, it's about effectively placing and using methods. Ramaze routing is regex based, not key based like Rails etc, that is why some of things you both are mentioning aren't there.</description>
		<content:encoded><![CDATA[<p><code>PIERS and </code>RONNY the article isn&#8217;t about the functionality, it&#8217;s about effectively placing and using methods. Ramaze routing is regex based, not key based like Rails etc, that is why some of things you both are mentioning aren&#8217;t there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Silvermonkey</title>
		<link>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/#comment-61</link>
		<dc:creator>Silvermonkey</dc:creator>
		<pubDate>Tue, 29 Apr 2008 09:11:54 +0000</pubDate>
		<guid>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/#comment-61</guid>
		<description>10 PRINT "DISCO DUMP!"
20 GOTO 10

Now that ladies is beauty!</description>
		<content:encoded><![CDATA[<p>10 <span class="caps">PRINT</span> &#8220;<span class="caps">DISCO</span> DUMP!&#8221;<br />
20 <span class="caps">GOTO</span> 10</p>
<p>Now that ladies is beauty!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronny Pfannschmidt</title>
		<link>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/#comment-59</link>
		<dc:creator>Ronny Pfannschmidt</dc:creator>
		<pubDate>Tue, 29 Apr 2008 08:05:32 +0000</pubDate>
		<guid>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/#comment-59</guid>
		<description>imho this implementation lacks a very important feature

generating a url from a rule + some values,
preferable based on the current "mount point" of the application</description>
		<content:encoded><![CDATA[<p>imho this implementation lacks a very important feature</p>
<p>generating a url from a rule + some values,<br />
preferable based on the current &#8220;mount point&#8221; of the application</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Piers Cawley</title>
		<link>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/#comment-58</link>
		<dc:creator>Piers Cawley</dc:creator>
		<pubDate>Tue, 29 Apr 2008 05:53:45 +0000</pubDate>
		<guid>http://avdi.org/devblog/2008/04/27/on-beauty-in-code/#comment-58</guid>
		<description>I'm not sure that I'm such a fan of the code to be honest. The fact that the if/ifelse cascade can't be replaced with a &lt;code&gt;case&lt;/code&gt; statement is a bit of a worry. Combine this with the use of &lt;code&gt;is_a?&lt;/code&gt; and &lt;code&gt;respond_to?&lt;/code&gt; and the fact that every consequence has its own nested if and it starts to smell of structural code.

I realise that it's going to increase the line count, but I'd prefer to introduce a few subclasses of Route (FilteredRoute, ProcRoute and StringRoute, say) and parcel the conditional logic out appropriately. Stick the key/value stuff in a &lt;code&gt;make_route&lt;/code&gt; method, called from &lt;code&gt;[]=&lt;/code&gt; and the path munging into &lt;code&gt;subclass#resolve&lt;/code&gt; methods and you start to have a collection of objects interacting with each other rather than a bunch of code messing with datastructures.

It may not be a refactoring worth doing when there's only three route types, but I would definitely be inclined to do it if the need arose for another kind of route.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure that I&#8217;m such a fan of the code to be honest. The fact that the if/ifelse cascade can&#8217;t be replaced with a <code>case</code> statement is a bit of a worry. Combine this with the use of <code>is_a?</code> and <code>respond_to?</code> and the fact that every consequence has its own nested if and it starts to smell of structural code.</p>
<p>I realise that it&#8217;s going to increase the line count, but I&#8217;d prefer to introduce a few subclasses of Route (FilteredRoute, ProcRoute and StringRoute, say) and parcel the conditional logic out appropriately. Stick the key/value stuff in a <code>make_route</code> method, called from <code>[]=</code> and the path munging into <code>subclass#resolve</code> methods and you start to have a collection of objects interacting with each other rather than a bunch of code messing with datastructures.</p>
<p>It may not be a refactoring worth doing when there&#8217;s only three route types, but I would definitely be inclined to do it if the need arose for another kind of route.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
