<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>thinking in geek &#187; rails</title>
	<atom:link href="http://joshrobb.com/blog/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshrobb.com/blog</link>
	<description>tagline's are so web2.0</description>
	<lastBuildDate>Wed, 02 Jun 2010 14:47:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>[ControllerAction] and sane defaults</title>
		<link>http://joshrobb.com/blog/2007/12/11/controlleraction-and-sane-defaults/</link>
		<comments>http://joshrobb.com/blog/2007/12/11/controlleraction-and-sane-defaults/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 02:04:35 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/12/11/controlleraction-and-sane-defaults/</guid>
		<description><![CDATA[[Ed: For anyone who's living under a bush Microsoft have released a CTP of the new ASP.NET MVC framework. ] I&#8217;m reluctant to get involved in this &#8211; but I feel like there&#8217;s another side to this story which is worth considering. Since it was first presented at altnetconf &#8211; the decision to require users1 [...]]]></description>
			<content:encoded><![CDATA[<p>[Ed: For anyone who's living under a bush Microsoft have released a CTP of the new ASP.NET MVC framework. ]</p>
<p>I&#8217;m reluctant to get involved in this &#8211; but I feel like there&#8217;s another side to this story which is worth considering.</p>
<p>Since it was first presented at altnetconf &#8211; the decision to require users<sup>1</sup> to have to specify which methods on controllers are available to be routed to ([ControllerAction]) and which view (RenderView()) to render has come in for <a href="http://www.lostechies.com/blogs/sean_chambers/archive/2007/12/08/phil-haack-posts-about-asp-net-mvc.aspx">a</a> <a href="http://tech.groups.yahoo.com/group/altnetconf/msearch?query=%5BControllerAction%5D&amp;submit=Search&amp;charset=ISO-8859-1">lot </a>of <a href="http://ayende.com/Blog/archive/2007/12/08/Configuration-over-Convention.aspx">criticism</a>.</p>
<p>Lots of the brightest and best minds in the .net world are screaming about this in various forums. Claiming that it violates:</p>
<ul>
<li> the DRY principle</li>
<li>convention over configuration</li>
<li>best practice in other frameworks</li>
<li>commonly accepted laws of physics</li>
</ul>
<p>Not one of the people complaining is going to use this framework vanilla. They are going to add their own layer of behavior over the top. It&#8217;s been designed to make it easy (trivial in this case) to extend and change the policy.</p>
<p>Sane defaults are <strong>really</strong> important for frameworks. Yes they get in the way of power users.  Yes it normally takes a power user 10 minutes to work around them and add that piece of code to their toolbox from then on.</p>
<p>I don&#8217;t know how many people were following the emergent rails community back in 2005 when the Google <a href="http://www.37signals.com/svn/archives2/google_web_accelerator_hey_not_so_fast_an_alert_for_web_app_designers.php">Web Accelerator</a> was <a href="http://radar.oreilly.com/archives/2005/05/google_web_acce_1.html">released</a> &#8211; but many of them (including the <a href="http://www.loudthinking.com/arc/000454.html">smartest</a><sup>2</sup> ) got a <a href="http://www.intertwingly.net/blog/2005/05/06/This-Stuff-Matters">salient</a> <a href="http://www.intertwingly.net/blog/2005/10/24/Theyre-baaaaaaack">lesson</a> in <a href="http://www.w3.org/2001/tag/doc/whenToUseGet.html">GET idempotence</a>. (i.e. GET Order?id=23&amp;action=delete &#8211; should <em>never</em> delete anything).</p>
<p>Here was a situation where the framework (rails) came with not so safe defaults and bad example code which encouraged doing the wrong thing.  These days &#8211; rails has absorbed this lesson so completely that it could be described as a REST server and in some ways leads developers into following best practices for web apps by default.</p>
<p>I really don&#8217;t understand what the huge deal is here? This seems as clear cut to me as the built in RequestValidation in ASP.NET or automatically escaping SqlParameters for SQL injection. Sure &#8211; if your a power user it can be a pain &#8211; but it takes 10 seconds to turn off and then your responsible when your site get p0wn&#8217;d.</p>
<p>It&#8217;s not like ControllerBase is sealed.</p>
<ol class="footnotes"><li id="footnote_0_48" class="footnote">by default &#8211; but <a href="http://haacked.com/archive/2007/12/09/extending-asp.net-mvc-to-add-conventions.aspx">easily modifiable</a></li><li id="footnote_1_48" class="footnote">or is that loudest?</li></ol>]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/12/11/controlleraction-and-sane-defaults/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SoC in WebForms</title>
		<link>http://joshrobb.com/blog/2007/08/02/soc-in-webforms/</link>
		<comments>http://joshrobb.com/blog/2007/08/02/soc-in-webforms/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 16:40:40 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[castle]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[web architecture]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/08/02/soc-in-webforms/</guid>
		<description><![CDATA[Scott Bellware makes a brillant comment on Hammett&#8217;s weblog: ASP .NET templated controls did almost nothing to encourage separation of orthogonal concerns. It simply ended up separating concerns that aren’t separate concerns. Pure Genius &#8211; this summarises an entire field of criticism (e.g. [1][2]). The whole issue with the OnRowDataBound/FindControl() style of programming is that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codebetter.com/blogs/scott.bellware/">Scott Bellware</a> makes a <a href="http://hammett.castleproject.org/?p=183#comment-21908">brillant comment</a> on <a href="http://hammett.castleproject.org/">Hammett&#8217;s</a> weblog:</p>
<blockquote><p>ASP .NET templated controls did almost nothing to encourage separation of orthogonal concerns. It simply ended up separating concerns that aren’t separate concerns.</p></blockquote>
<p>Pure Genius &#8211; this summarises an entire field of criticism (e.g. <a href="http://www.ayende.com/Blog/archive/2007/07/23/The-Correct-Separation-Of-Concerns.aspx">[1]</a><a href="http://hammett.castleproject.org/?p=161">[2]</a>). The whole issue with the OnRowDataBound/FindControl() style of programming is that things which are fundamentally simple (iteration and string concatenation) are impossibly complex because concerns have been separated which are not orthogonal.</p>
<p>There&#8217;s an important caveat  to this &#8211; which is that WebForms is actually trying to solve a different problem from the one that I and many other developers build web apps are trying to solve. WebForms was intended to allow VB6 windows programmers to build web based apps &#8211; without having to understand HTTP, HTML, CSS, Javascript, GET/POST/HEAD etc.</p>
<p>This has actually proven to work pretty well in specific circumstances. e.g. A team of developers building an inhouse (intranet) line of business app. A good friend of mine was tasked to lead a team of 20 or so Oracle Designer developer in building a next gen version of the product they had been working on in ASP.NET 1.1. They were able to pick it up and get productive remarkably quickly because they could continue to work with a Control based, form based model that was familar to them.</p>
<p>Where it&#8217;s made life immeasurably harder is for developers who are building public facing web apps. Apps the HTML they&#8217;re actually emitting matters, where cross browser compat is something that needs to be deeply understood &#8211; not abstracted away (thats a whole &#8216;nother post).</p>
<p>The reason this is even an issue is because of the Microsoft DevDiv monoculture. If it&#8217;s a Microsoft solution then it&#8217;s obviously the best. In the Java world &#8211; there&#8217;s JSP (classic asp using Java) and JSF (roughly webforms) &#8211; but there&#8217;s a whole boatload of other solutions to problems.</p>
<p>I don&#8217;t see anyone arguing that the only right way to build web apps using java is to use JSF. People are free to examine the problems they face, look at the solutions proposed by various other people who have published their work (e.g. Tapestry, Grails, RIFE, Struts, WebWork, Struts 2 etc&#8230;) and either use an existing solution or roll their own. Same in the Python (Django, Web.py, Zope), PHP (Zend Framework, Cake, various PEAR libraries), Perl and pretty much any other community you care to examine.</p>
<p>Which tool is right for you depends entirely on your context (the problem, your experience, your team, their experience etc). If Webforms is working for you &#8211; then fantastic but it&#8217;s not the right solution for everyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/08/02/soc-in-webforms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails as the Visual Basic of the Web</title>
		<link>http://joshrobb.com/blog/2007/04/13/rails-as-the-visual-basic-of-the-web/</link>
		<comments>http://joshrobb.com/blog/2007/04/13/rails-as-the-visual-basic-of-the-web/#comments</comments>
		<pubDate>Fri, 13 Apr 2007 14:12:26 +0000</pubDate>
		<dc:creator>josh</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web architecture]]></category>

		<guid isPermaLink="false">http://joshrobb.com/blog/2007/04/13/rails-as-the-visual-basic-of-the-web/</guid>
		<description><![CDATA[A couple of things have got me thinking along these lines recently. Giles Bowkett made an interesting post on his blog: &#8220;[T]his has always been my fear for Rails; that in five to ten years, the worst jobs you could get will be Rails jobs where you&#8217;re maintaining stuff built by non-programmers who figured Rails [...]]]></description>
			<content:encoded><![CDATA[<address>A couple of things have got me thinking along these lines recently.</address>
<ol>
<li>Giles Bowkett made an <a href="http://gilesbowkett.blogspot.com/2007/03/conversation-with-reg-braithwaite.html">interesting post</a> on his blog:<br />
<blockquote><p>&#8220;[T]his has always been my fear for Rails; that in five to ten years, the worst jobs you could get will be Rails jobs where you&#8217;re maintaining stuff built by non-programmers who figured Rails made programming so easy that they didn&#8217;t really need to understand what they were doing.&#8221;</p></blockquote>
</li>
<li> In <a href="http://smallthought.com/avi/">Avi Bryant</a>&#8216;s ETech presentation <a href="http://smallthought.com/avi/?p=20">Applied Web Heresies</a> (<a href="http://smallthought.com/avi/etech.pdf">slides</a>) he makes the following statement:<br />
<blockquote><p>&#8220;Meaningful <acronym title="Uniform Resource Locators">URL</acronym>s don&#8217;t carry enough meaning<br />
Names make me think too much<acronym title="Don't repeat yourself"><br />
DRY</acronym> (not everything is an <acronym title="Application Programming Interface">API<acronym>)&#8221;</acronym></acronym></p></blockquote>
</li>
</ol>
<p>This is reminiscent of Visual Basic (and VBA, Access etc..). I know I&#8217;ve done maintenance on some scary code which was written by someone who didn&#8217;t understand enough about what they were doing.</p>
<p><strong>Not Everything is an API </strong></p>
<p>The obsession of Rails dudes with making every object a <acronym title="REpresentational State Transfer">REST</acronym> endpoint is a particularly scary form of religion. In VB6 every &#8220;class&#8221; was exposed as a COM object. For those of you who are not familiar with COM &#8211; this means that every public class in your application was exposed as an API. Weather you wanted it available to other applications or not. As you can imagine &#8211; this resulted in some truly monstrous misuse of parts of applications by other applications and lead to the worst kind of spaghetti dependencies imaginable (circular build dependencies etc).</p>
<p>In general API&#8217;s should be carefully thought through, designed and exposed as a separate development exercise from building a web application. For example:</p>
<ol>
<li>Google maps was released</li>
<li>People started hacking mashups using it.</li>
<li>The GMaps team went away and <em>designed</em> a JavaScript api which is:
<ul>
<li>versioned</li>
<li>licenced</li>
<li>secure</li>
<li>supportable</li>
</ul>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://joshrobb.com/blog/2007/04/13/rails-as-the-visual-basic-of-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
