<?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>casperfabricius.com &#187; railsconf</title>
	<atom:link href="http://casperfabricius.com/site/category/railsconf/feed/" rel="self" type="application/rss+xml" />
	<link>http://casperfabricius.com/site</link>
	<description>expert ruby on rails development</description>
	<lastBuildDate>Sun, 06 Jun 2010 08:43:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Notes and impressions from RailsConf 2009</title>
		<link>http://casperfabricius.com/site/2009/05/08/notes-and-impressions-from-railsconf-2009/</link>
		<comments>http://casperfabricius.com/site/2009/05/08/notes-and-impressions-from-railsconf-2009/#comments</comments>
		<pubDate>Fri, 08 May 2009 19:49:24 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[agile]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=217</guid>
		<description><![CDATA[I&#8217;d never have guessed that the first time I&#8217;d visit Las Vegas, the gambling and the drinking, the shows and the shopping would be a minor thing, something that I&#8217;d squeeze in between what really mattered. But RailsConf 2009 had such a comprehensive and interesting program that this ended up being the case. From the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d never have guessed that the first time I&#8217;d visit Las Vegas, the gambling and the drinking, the shows and the shopping would be a minor thing, something that I&#8217;d squeeze in between what really mattered. But RailsConf 2009 had such a comprehensive and interesting program that this ended up being the case. From the casual networking at breakfast and lunch over packed keynotes and high-quality talks to late-night Birds Of a Feather sessions, RailsConf did give the attendants any reason to step out if the air-conditioned Hilton and into the sun and lights of the Strip.</p>
<p>We did that anyway, obviously, but mostly we were learning, tweeting, chatting, coding, emailing and taking notes at a conference where the wifi actually worked and power strips were easily available. I&#8217;m not going to reference all the talks that I went to here, but I have uploaded my notes <a href="http://casperfabricius.com/site/wp-content/uploads/2009/05/">here</a>. Also, I&#8217;ve written a detailed summery of David Heinemeier Hansson&#8217;s keynote and a few select talks that I attended for <a href="http://railsmagazine.com/issues/2">RailsMagazine</a>, <strike>but the free PDF-edition won&#8217;t be available for another two weeks</strike> now freely available for download &#8230; slides from all the presentations can be found <a href="http://www.scribd.com/group/74983-railsconf-2009">here</a>.</p>
<p><span id="more-217"></span></p>
<p>So what did I take away from RailsConf from the top of my head? The first that springs to mind, is that I got to try <a href="http://www.jetbrains.com/ruby/index.html">RubyMine</a>, a new IDE for Ruby on Rails. At first glance this might look like another Aptana or Netbeans, but the <a href="http://railsenvy.com/">Rails Envy</a> guys gave a stunning demonstration of the power of this new IDE: From TextMate keymapping and navigation, over code completion and refactoring that actually works, to automatic diagramming of models and their relationships, this product looks like a real productivity booster. I&#8217;m going to try it out the minute I get home.</p>
<p><i>Rack</i> kept popping up everywhere. Lots of talks on Rack and Rails Metal (which is really just a wrapper for a &#8220;raw&#8221; Rack handler), and now Rack suddenly doesn&#8217;t feel so scary anymore. It just a way to do cool things on a raw request and/or response without the (full) overhead of the Rails stack. <i>JRuby</i> was another popular topic, as well as <i>clouds</i> &#8211; how to deploy to server environment that will seamlessly scale with your needs.</p>
<p>I have been following IronRuby with great interest since the project was started 2-3 years ago, and I was a bit disappointed to hear that the .NET implementation of Ruby is still nowhere near completed. I asked Jimmy Schementi from the Microsoft IronRuby team what took them so long (to be honest, I was a bit rude, sorry Jimmy), and asked that things simply took time. He said that JRuby had been 6 years underway. The positive news, however, was that the IronRuby team is still very committed to making their implementation fully Ruby 1.8 compliant, and that are using Rails to measure their success against.</p>
<p>I&#8217;d love to tell you more, but my plane is leaving soon, so you will have to make do with <a href="http://casperfabricius.com/site/wp-content/uploads/2009/05/">my notes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/05/08/notes-and-impressions-from-railsconf-2009/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Introductions to Ruby on Rails</title>
		<link>http://casperfabricius.com/site/2009/04/22/introductions-to-ruby-on-rails/</link>
		<comments>http://casperfabricius.com/site/2009/04/22/introductions-to-ruby-on-rails/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 07:45:03 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[agile]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=212</guid>
		<description><![CDATA[You have at least two chances to get introduced to Ruby on Rails by yours truly this year. I do a presentation on Rails with a focus on ActiveRecord, the ORM of Rails, on Commity Day 2009 in Copenhagen. I am also teaching Rails used with agile methods at Copenhagen Business School this fall.
Community Day [...]]]></description>
			<content:encoded><![CDATA[<p>You have at least two chances to get introduced to Ruby on Rails by yours truly this year. I do a presentation on Rails with a focus on ActiveRecord, the <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a> of Rails, on <a href="http://communityday.in/copenhagen/">Commity Day 2009</a> in Copenhagen. I am also teaching Rails used with agile methods at <a href="http://cbs.dk/">Copenhagen Business School</a> this fall.</p>
<p>Community Day 2009 is free 1-day event May 28 in Copenhagen sponsored by Danish developer communities. Besides my two cents, it also features presentations on Android, Flex, Air, Silverlight, LINQ, Drupal, jQuery and ASP.NET MVC &#8211; in other words it looking to be a lot of buzzwords and popular technologies explained. As if that wasn&#8217;t enough, the day also include three geek-friendly meals, friendly competitions and lots of free beer.</p>
<p>The course I will be teaching at Copenhagen Business School is called Agile Development in Practice, and builds upon a theoretic platform of agile methods. The course focus is on giving the students practical experience with Scrum and Ruby on Rails through a combination of traditional teaching and working with real-life examples. The course is free to attend for all Danish students, and counts for either 7,5 or 15 ETCS points. Others can also enroll in the course for a fee. The course description is not yet available on the CBS homepage, but I will link to here as soon as it is ready.</p>
<p>But before all that, I myself will hopefully learn many new and useful things about Ruby, Rails and all things geeky at <a href="http://en.oreilly.com/rails2009/">RailsConf</a> in Las Vegas. See you there? :)</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/04/22/introductions-to-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Merb</title>
		<link>http://casperfabricius.com/site/2009/01/01/hello-merb/</link>
		<comments>http://casperfabricius.com/site/2009/01/01/hello-merb/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 15:46:32 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/cfp/casperfabricius.com/site/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[engines]]></category>
		<category><![CDATA[radiant]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=158</guid>
		<description><![CDATA[Merb is getting merged into Ruby on Rails. Together they will become Rails 3, as announced by David Heinemeier Hansson here and Yehuda Katz here.
I wish I could claim to have been playing with Merb for a while and have some real insight into the framework, but to be honest, I haven&#8217;t. I still think [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.merbivore.org/">Merb</a> is getting merged into <a href="http://www.rubyonrails.com">Ruby on Rails</a>. Together they will become Rails 3, as announced by David Heinemeier Hansson <a href="http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3">here</a> and Yehuda Katz <a href="http://yehudakatz.com/2008/12/23/rails-and-merb-merge/">here</a>.</p>
<p>I wish I could claim to have been playing with Merb for a while and have some real insight into the framework, but to be honest, I haven&#8217;t. I still think this a very interesting news, though, and in my opinion this can only be good news for the Rails community. Already, the brilliant Merb guys are optimizing and improving Rails, for instance <a href="http://yehudakatz.com/2008/12/27/status-memorandum/">this 8% speed boost in using <code>respond_to</code></a>.</p>
<p>So, how can we expect the the merge to affect the Rails framework we know and love? Let&#8217;s peek into the possibilities of combining these two frameworks.</p>
<p><span id="more-158"></span></p>
<p>One change that seems certain, is changes to the <b>routing system</b>. &#8220;Plans are already underway to port the Merb router over to Rails. At the very least, you will have the option to use the Merb DSL syntax instead of the Rails hash-based syntax. We’ll see which one becomes the default.&#8221; Katz <a href="http://yehudakatz.com/2008/12/29/another-rails-2x3-update/">says</a>. David <a href="http://www.loudthinking.com/posts/37-bringing-merbs-providesdisplay-into-rails-3">explains</a> how Merb concepts for rendering resources in different formats will be used in Rails 3, but with more intuitive or &#8220;Rails-like&#8221; naming.</p>
<p>Another change which is likely to make it into Rails 3 is <b>slices</b>, as indicated by Katz in a response to his own <a href="http://yehudakatz.com/2008/12/23/rails-and-merb-merge/">announcement</a>. Slices are &#8220;similar to what Rails-Engines promise, except merb-slices are built into the framework&#8221; as Ezra Zygmuntowicz <a href="http://brainspl.at/articles/2008/05/21/merb-slices">explains</a>. This is exiting news! I&#8217;ve always been interested gaining leverage by having reusable application slices, and I&#8217;ve actively built and used both <a href="http://rails-engines.org/">Rails Engines</a> and <a href="http://casperfabricius.com/site/2007/07/19/advanced-radiant-extensions/">Radiant extensions</a>. Engines has previously been frowned upon by leading figures in the Rails community, but it has been improved to work in a quite clean and easy-to-understand manner since the release of Rails 2.0, and are in fact compared to Merb slices <a href="http://rails-engines.org/news/2008/05/24/merb-slices-again/">here</a>. Radiant extensions are obviously only for Radiant CMS-based websites, but the <a href="http://ext.radiantcms.org/extensions">diversity</a> of these extensions illustrates the potential of getting support for real full-stack application slices into the Rails core. A project like <a href="https://github.com/svenfuchs/adva_cms/tree">Adva CMS</a> also illustrates how it is possible to build high quality reusable application slices for the common good.</p>
<p>A third change I hope to see as a result of the merge is <b>controller-based mailers and partials</b>. <code>ActionMailer</code> has always been a bit of an ugly stepchild in the Rails framework, and the positioning of a <code>Mailer</code> as a sort-of model, but with templates, doesn&#8217;t seem logic to me. Merb has an <code>AbstractController</code> class that both mailers and partials (called parts in Merb) inherit from, which allows for a more intuitive control in rendering mails and parts.</p>
<p>I was curious to find out how the Merb community has reacted to this decision. The Rails community doesn&#8217;t seem to be overly concerned. Perhaps it&#8217;s because the merge of Merb and Rails are called &#8220;Rails 3&#8243;. Not &#8220;Merb 2&#8243;, not &#8220;MerbRails&#8221; &#8211; the names clearly signals that the merge will be done on Rails&#8217; terms. While it has become popular in the Rails community to dissociate one self with David Heinemeier Hansson, I still think people sees him as a good security for not letting the Rails principles go in the merge.</p>
<p>I browsed through the more than 100 comments to <a href="http://yehudakatz.com/2008/12/23/rails-and-merb-merge/">Yehuda Katzs announcement</a> of the merge, and while about half of the commenters simply expresses their happiness and agreement with the decision, the objections of the other half falls roughly into three categories: Technical, personal and economic.</p>
<p>The <b>technical concerns</b> are of course fully expected, and some of the more interesting are:</p>
<ul>
<li>&#8220;Does merging a lightweight framework into a bloated framework make the bloated framework any lighter?&#8221;</li>
<li>&#8220;I really hope that merb will be able to continue it’s ‘no-magic’ attitude and bring that to rails without compromises&#8221;</li>
<li>&#8220;I would have liked to see merb go further on its own just to push the envelope further&#8221;</li>
<li>&#8220;How many planned advancements are being put on hold while Rails catches up?&#8221;</li>
</ul>
<p>The <b>personal objections</b> is about one very visible person: David Heinemeier Hansson. I hold no grudge against David, so I shall only repeat one of the more curious comments in this category: &#8220;The big problem, as always with Rails, is DHH: a vainglorious, two-faced prima donna with a massive and fragile ego. He’s good, but not nearly as unique and amazing as he thinks he is. I went to Merb to get away from DHH. Ugh.&#8221; If many people in the Merb community feels like this guy, I understand if they are concerned that David will simply steamroller the philosophy of Merb. David has been fast to <a href="http://www.loudthinking.com/posts/36-work-on-what-you-use-and-share-the-rest">address these concerns</a>, but the question is if just saying everyone should work on what the care about is enough.</p>
<p>The <b>economic perspective</b> of the merge is where things gets interesting. Rails is trademarked by David and synonymous with <a href="http://www.37signals.com">37signals</a>, while Merb is very closely linked to <a href="http://www.engineyard.com">EngineYard</a>. Two commenters really nail it down:</p>
<ul>
<li>&#8220;How has the ‘Opinionated Software’ philosophy of “Fuck You (DHH)” Rails become aligned with the ‘open’ and democratic philosophy of Merb? Is this some kind of preemptive marketing in advance of a joint investment in both Engine Yard and 37 Signals by a common investor?&#8221;</li>
<li>&#8220;My suspicion turns to the fact that almost every Merb core team member is owned by Engine Yard. Something doesn’t smell right.&#8221;</li>
</ul>
<p>It&#8217;ll be interesting to follow not just the architectural design choices made on the technical front during the merge process, but also how this will change the positioning of 37signals and EngineYard, and if the two companies are really warming up to some kind of close relationship.</p>
<p>The timeline for a first peek at Rails 3 &#8211; the union of Merb and Rails &#8211; is <a href="http://merbist.com/2008/12/23/rails-and-merb-merge/">said</a> to be RailsConf 2009 &#8211; 4 months from now.</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2009/01/01/hello-merb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RailsConf Europe 2008 write-up</title>
		<link>http://casperfabricius.com/site/2008/09/13/railsconf-europe-2008-write-up/</link>
		<comments>http://casperfabricius.com/site/2008/09/13/railsconf-europe-2008-write-up/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 17:39:33 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<category></category>
	<category></category>
	<category></category>
	<category></category>
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/site/?p=122</guid>
		<description><![CDATA[

&#169; 2008 Jacob Lauemøller

We had meeting in Copenhagen Ruby Brigade the other night with a theme of &#8220;Present something interesting from this year&#8217;s RailsConf Europe&#8221;. Three had found the time to prepare a presentation, and I was one of them. I gave a summary of the Juggernaut presentation, not only because it was interesting and [...]]]></description>
			<content:encoded><![CDATA[<div class="photo left"><a href="http://www.flickr.com/photos/jlauemoeller/2839127886/in/set-72157607175283477"><img src="http://farm4.static.flickr.com/3074/2839127886_a8e0227dcf_m_d.jpg" alt="RailsConf Europe Danes dinner" /><br />
</a>
<div class="caption">&copy; 2008 <a href="http://www.flickr.com/photos/jlauemoeller/">Jacob Lauemøller</a></div>
</div>
<p>We had meeting in <a href="http://www.copenhagenrb.dk">Copenhagen Ruby Brigade</a> the other night with a theme of &#8220;Present something interesting from this year&#8217;s RailsConf Europe&#8221;. Three had found the time to prepare a presentation, and I was one of them. I gave a summary of the <a href="#">Juggernaut presentation</a>, not only because it was interesting and entertaining (the original presentation, not my summary!), but because it really made me feel like start coding an application using Juggernaut right away. <a href="#">Juggernaut</a> is a small server and a Rails plugin that allows the web server to push information in real time to clients using an open Flash socket. The syntax for pushing data (typically javascript or JSON) to client is very similar to RJS, e.g.:</p>
<pre><code>render :juggernaut do |page|
    page.insert_html :top, 'chat_data', "#{h(params[:chat])}"
  end</code></pre>
<p>When a client wants to broadcast to other clients, it simply fires an ordinary AJAX request to a controller, which in turn passes the message on through Juggernaut. The presenters showed a running example where the audience could place their home towns on a Google Map, which updated in real time as people used it. There is something fundamentally fun about coding real time interaction between multiple clients, at least that&#8217;s how I feel. Perhaps it goes back to my time as a developer on a large-scale European chat site, but ironically I worked on everything but the real time communication during that time.</p>
<p><span id="more-122"></span></p>
<p>I had looked forward to the talk about the new localization (l10n) and internationalization (i18n) features of Rails 2.2, and especially to see and meet <a href="#">Sven Fuchs</a>. We never managed to meet before the presentation or talk much after (sorry Sven, my bad!), but the presentation was well-structured and well executed, and the prospects of having a default interface for i18n in Rails are great! Sven explained that he and the other i18n contributors had (after long discussions) made three key decisions:</p>
<ul>
<li>Do the simplest thing that could ever work for Rails</li>
<li>Make a 100% swappable back end</li>
<li>Do not aim for a full-blown l10n solution</li>
</ul>
<p>These are three very important decisions. The very different approaches various i18n plugins for Rails have had clearly show that people&#8217;s needs are very different when it comes to l10n and i18n. Some really just need to run their application in a single language that is not English. Some like to have translations stored in YAML files for easy versioning and others like to have them in the database for easy changes through a web interface. Some need full blown i18n of currency, dates, times and even the layout of content.</p>
<p>This has resulted in a simple, yet powerful i18n API that centers around the I18n class. <code>I18n.translate</code> (aliased as <code>I18n.t</code>) returns a translated string. <code>I18n.localize</code> (aliased as <code>I18n.l</code>) returns a localized time, date, currency etc. The I18n class is completely back end / plugin agnostic, but Rails ships with <i>SimpleBackend</i> which allows English and other latin languages with English-like grammar to be loaded from YAML-files. However, Sven underlined that he hopes that people will start building many small i18n and l10n plugins serving specific needs, and get away from big plugins that tries to serve all, but never does so satisfactory. Globalize2 is on its way, he said, but that will be a complete rewrite and a much smaller plugin than the current.</p>
<p>I also took a lot away from the talk on advanced REST. Most of us understand the basics of RESTful architecture and modeling by now, but in a number of cases the whole resource/CRUD paradigm doesn&#8217;t seem to fit so well. <a href="http://www.culann.com">Ben Scofield</a> took us through a number of such cases and suggested solutions for each:</p>
<ul>
<li>Password resets: <code>map.resources :users, :has_one => :password</code> (password is a resource by itself, and each user has one)</li>
<li>Previews: <code>map.resources :posts, :has_one => [:preview]</code> (preview is a seperate resource that is not created in the database)</li>
<li>Search: <code>map.resource :search</code> (use the index action with a query, not post)</li>
<li>Wizards: Take the user past different resources, e.g. <code>/galleries/new</code> -> <code>/restaurants/:id/photos/new</code> -> <code>/restaurants/:id/photos/edit</code></li>
</ul>
<p><strike>Ben also recommended the <a href="http://github.com/jcfischer/make_resourceful/tree">make_resourceful</a> as his preferred plugin for handling common RESTful tasks</strike> Ben said the RESTful controller plugins was too much magic for him, but he recommended the audience to take a look at the projects <a href="http://github.com/bmizerany/sinatra/tree">Sinatra</a>, <a href="http://github.com/dyoder/waves/tree">Waves</a> and <a href="http://github.com/mtodd/halcyon/tree">Halcyon</a>.</p>
<p>There where many other talks that I liked, but as we discussed at the Copenhagen Ruby Brigade meeting, the technical level was a bit too low, there weren&#8217;t many really new insights and woah! moments, and there where many empty slots! One must wonder how we could end up with I think around 6-8 empty slots during just two days? There was, after all, presentaion proposals enough to arrange a RejectConf. Anyway, RailsConf US will be in Las Vegas next year, so &#8230; I mean &#8230; do we have any choice, really? Rumors also say that RailsConf Europe will take place in Barcelona next year &#8211; another tempting destination!</p>
<p>One final note: I put a new design on my blog &#8211; what do you think? I made the change because I am now an independent Ruby on Rails developer, and I like the swirly light design of this theme as well as the orange box (also an awesome game bundle) where I can present myself.</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2008/09/13/railsconf-europe-2008-write-up/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>David&#8217;s RailsConf Europe 2008 keynote: Legacy, concerns and DRY exceptions</title>
		<link>http://casperfabricius.com/site/2008/09/03/legacy-concerns-and-dry-exceptions/</link>
		<comments>http://casperfabricius.com/site/2008/09/03/legacy-concerns-and-dry-exceptions/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 13:34:39 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<category></category>
	<category></category>
	<category>railsconf</category>
	<category>railsconfeurope</category>
	<category>railsconfeurope2008</category>
	<category></category>
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/blog/?p=68</guid>
		<description><![CDATA[Be proud of your legacy code. Extract concerns. Make exceptions from DRY. David Heinemeier Hansson&#8217;s keynote at RailsConf Europe 2008 was titled &#8220;Living with legacy software&#8221;, and centered around the notion of how to deal with your own old code. The articles summarizes the talk.

&#169; 2008 James Duncan Davidson

Rails has been around for 5 years [...]]]></description>
			<content:encoded><![CDATA[<p>Be proud of your legacy code. Extract concerns. Make exceptions from DRY. David Heinemeier Hansson&#8217;s keynote at <a href="http://en.oreilly.com/railseurope2008/">RailsConf Europe 2008</a> was titled &#8220;Living with legacy software&#8221;, and centered around the notion of how to deal with your own old code. The articles summarizes the talk.</p>
<div class="photo left"><a href="http://flickr.com/photos/x180/2823891043/"><img src="http://farm4.static.flickr.com/3227/2823891043_541e790064_m_d.jpg" alt="David Heinemeier Hansson" /></a>
<div class="caption">&copy; 2008 <a href="mailto:james@duncandavidson.com/">James Duncan Davidson</a></div>
</div>
<p>Rails has been around for 5 years now, and that&#8217;s an eternity in software, David said. People who are moving to Rails, see the platform as a salvation for their legacy applications, and as an excuse not to have to think anymore. That&#8217;s wrong, David pointed out with a big read slide.</p>
<p>People use the term legacy as though it is a well-defined attribute of code base, but it is really an personal opinion. &#8220;PHP is legacy! Java is legacy! &#8211; well, that one may be right&#8221;, David said jokingly, but really legacy is about your own evolvement of your taste, your knowledge and your personal preferences. Most people who wrote legacy code, thought the code was great when they wrote it. Later people&#8217;s perspective change, and even though the code hasn&#8217;t changed, it is suddenly considered legacy.</p>
<p><span id="more-65"></span></p>
<p>David compared code to a tomato. In the beginning you have a beautiful red tomato, but before you know it, it has turned into a rotten tomato. But it is not the software that change, it doesn&#8217;t rewrite itself. The code is not making itself worse, it is our perception that change. So why see legacy as a rotten tomato? Why can&#8217;t it be about you? You got smarter. You learned more. When that tomato got rotten, that was a process in you. That&#8217;s not something to feel sad or depressed about, that&#8217;s cause for celebration. Legacy software is not a negative thing, it&#8217;s a positive thing, as it shows that you have grown as programmer.</p>
<p>If you don&#8217;t accept that your code will become legacy, you will be disappointed again and again. The best programmers write the most legacy software. The more software you are writing, the more you are looking back thinking: &#8220;This feels stale and old&#8221;, the better you have become. Howver, you don&#8217;t change your perceptions as much when you have working with a platform for 5 years. The better you become, the longer you must spend on a project to learn something.</p>
<p>David quoted Joel Spolsky: <a href="http://www.joelonsoftware.com/articles/fog0000000017.html">&#8220;Good software takes 10 years to write&#8221;</a>, but then rephrased it to: &#8220;<i>Truly successful</i> software takes 10 years to write&#8221;. If you want to make something successful, you are going to have work with it for a long time. &#8220;Now is the time where Basecamp is having the most impact and reaching most people, so now is the time where I should be most engaged in it&#8221;, David said. The goal for everybody should be to be involved with software that could take 10 years to write, and be happy about it.</p>
<p>Another Joel Spolsky quote is: &#8220;The single worst strategic mistake that any software company can make: Rewrite the code from scratch&#8221;, and I fully believe in this, David said. &#8220;Basecamp was the very first project I wrote in Ruby, along with Rails. In so many ways, Basecamp felt so legacy to me.&#8221;  But you can&#8217;t solve all your legacy decisions in one big swoop, you have to do it step by step.</p>
<p>As a rule of thumb for cleaning up legacy code, David used: &#8220;You have to leave the code you touch in a better condition than you found it&#8221;. As an example, he showed the <code>ApplicationHelper</code> from Basecamp: 500 lines of different helper methods for a broad variety of purposes. The <code>ApplicationHelper</code> was introduced to solve the problem that helper methods, used in multiple controllers, had to be extracted into modules and included everywhere they where needed. Unfortunately this has turned <code>ApplicationHelper</code> into a garbage can &#8211; a broken window. Today, we can just write <code>helper :all</code> in our controllers, and this allows us to extract methods into separate helpers with describing names such as <code>LayoutHelper</code>. In fact, ApplicationHelper is supposed to be empty. It is a staging point, where you put things you don&#8217;t really know where to put. Just like you put things in lib before you put them in a plugin. But eventually, methods in <code>ApplicationHelper</code> should be put into separate helpers.</p>
<p>Then David introduced the notion of a <i>concern</i>. As an example, he showed the <code>Person</code> object of Highrise, which has a relation to <code>configuration</code>. This is only used for recording if the has seen a certain system notice, and is not really a core part of what defines a <code>Person</code>. For this reason, the code should be extraced into a <i>concern</i>, which is nothing more than a module with certain aspects of <code>Person</code>. A concern is not introduced for the purpose of reuse, but to heighten comprehension and coherence in your application.</p>
<p>A last point in the keynote was that exceptions from the DRY principle (Don&#8217;t Repeat Yourself) exists. It can be really hard to change just one thing a completely DRY application. As an example, David explained that Highrise has the abstract class <code>Recording</code>, which fits pretty well with three subclasses, but was giving him problems when a fourth subclass, quite different from the others, was introduced. This resulted in a very complicated view partial for recordings, and a more pragmatic solutions was to create a separate view for the new subclass, duplicating some code, but eliminating a lot of checks in the original partial.</p>
<p>Legacy ain&#8217;t so bad, David finished off, it keeps you honest about yourself and how you are growing as a programmer.</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2008/09/03/legacy-concerns-and-dry-exceptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes from RailsConf Europe 2007</title>
		<link>http://casperfabricius.com/site/2007/09/20/railsconf2007-notes/</link>
		<comments>http://casperfabricius.com/site/2007/09/20/railsconf2007-notes/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 18:10:52 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/blog/2007/09/20/railsconf2007-notes/</guid>
		<description><![CDATA[I&#8217;ve only written two blogs from RailsConf Europe this year, one about Dave Thomas&#8217; keynote; The Art in Rails, and one about David Heinemeier Hansson&#8217;s keynote, which has temporarily many-doubled the traffic to my blog after being referenced in Signals vs. Noise &#8211; thanks, Jason!
But those two keynotes was far from the only sessions I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve only written two blogs from RailsConf Europe this year, one about <a href="/blog/2007/09/17/railsconf-the-art-in-rails/">Dave Thomas&#8217; keynote; The Art in Rails</a>, and one about <a href="/blog/2007/09/18/railsconf2007-dhh/">David Heinemeier Hansson&#8217;s keynote</a>, which has temporarily many-doubled the traffic to my blog after being referenced in <a href="http://www.37signals.com/svn/posts/603-upcoming-37signals-speaking-engagements">Signals vs. Noise</a> &#8211; thanks, Jason!</p>
<p>But those two keynotes was far from the only sessions I attended worth blogging about, and I have been taking 2-6 KB notes from each and every session. Sadly though, I can&#8217;t seem to find the time to write a full article about each of them right now, albeit now is the time people want to read about the conference. So I thought I&#8217;d put out my notes from most of the sessions I attended (those worth reading), with a little description with each of them. There are also select <a href="http://conferences.oreillynet.com/pub/w/61/presentations.html">presentation slides</a> available.</p>
<p><b>A Half-day of Behavior-driven Development on Rails</b><br />
I enjoyed being taught the concepts of Behavior-driven Development by the creator of BDD, <a href="http://dannorth.net/">Dan North</a>, as well as I enjoyed getting the <a href="http://rspec.rubyforge.org/">rspec plugin</a> explained by its creators, <a href="http://blog.aslakhellesoy.com/">Aslak Hellesoy</a> and <a href="http://blog.davidchelimsky.net/">David Chelimsky</a>, although I noticed they had given up on trying to pronounce the name of the plugin &#8220;respec&#8217;&#8221;, as Aslak tried in vain when he was interviewed for the Ruby on Rails podcast.<br />
<i><a href="/blog/wp-content/uploads/2007/09/tutorial-bdd.txt">Download notes</a></i></p>
<p><b>Caching in a Multilanguage Environment</b><br />
<a href="http://www.workingwithrails.com/person/9095-benjamin-krause">Benjamin Krause</a> has been kind enough to write two plugins for handling <a href="http://svn.omdb-beta.org/plugins/mlr/">multilanguage routing</a> and multilanguage caching (link doesn&#8217;t seem to be available), respectively. In his talk, he explained why current Rails routing and caching is inefficient for multi-language sites, and the rationale behind his design decisions in the plugins.<br />
<i><a href="/blog/wp-content/uploads/2007/09/talk-multilanguage-caching.txt">Download notes</a></i></p>
<p><b>Meta-Magic in Rails: Become a Master Magician</b><br />
<a href="http://drnicwilliams.com/">Dr. Nic</a> put on a great show explaining Ruby meta-programming, stressing that introspection is the ability to look at your own code, while reflection is the ability to change your on code dynamically. He also compared Perl to a puppy (fun, but with no understanding of itself), Java to Keith Richards (not so cute anymore) and Rails to Neo (knows about and can change his environment). Finally, the good doctor demonstrated a quite useless, though fun, plugin <strike>he had created</strike> <a href="http://drnicwilliams.com/2007/07/23/magic-wiggly-lines-guessmethod-by-chris-shea/">written by Chris Shea</a>; <code>guessmethod</code>, which attempts to catch and correct misspelled contant and method names dynamically.<br />
<i><a href="/blog/wp-content/uploads/2007/09/talk-drnic.txt">Download notes</a></i></p>
<p><b>The Forgotten Child: Powerful CSS with Rails</b><br />
At the other end of the frontend-backend scale, but just as entertaining, <a href="http://geoffreygrosenbach.com/">Geoffrey Grosenbach</a> talked about the possibilities of generating CSS. A simple approach is to add CSS as a format recognized by Rails and then generate stylesheets using ERb, but the Rails Podcast author also explained about the opportunities of <a href="http://haml.hamptoncatlin.com/docs/sass">SASS</a>, a powerful Rails plugin for simplifying, beautifying and DRYing up stylesheets.<br />
<i><a href="/blog/wp-content/uploads/2007/09/talk-css.txt">Download notes</a></i></p>
<p><b>Lightning Talks</b><br />
A cancelled talk opened up the possibility for a lightning talk session, and several of the core team members was on the spot. <a href="http://www.vernix.org/marcel/">Marcel Molina</a> started out, demonstrating his forthcoming plugin <code>render_with_presenter</code>, and did an many ways a better job of explaining the presenter pattern than Jay Fields did the following day. As a seemingly more advanced alternative to the <a href="http://comatose.rubyforge.org/">Comatose CMS plugin</a>; Sandstone (to be released as open source) was also introduced, and <a href="http://blog.leetsoft.com/">Tobias Lütke</a> did a good job of explaining the benefits of using <a href="http://www.liquidmarkup.org/">Liquid</a> as a Rails renderer.<br />
<i><a href="/blog/wp-content/uploads/2007/09/lightning-talks.txt">Download notes</a></i></p>
<p><b>Best Practices</b><br />
Core team members Marcel Molina and <a href="http://www.koziarski.net/">Michael Koziarski</a> stressed that while there a plenty of resources telling you what you <i>could</i> do in Rails, they wanted to tell us what we <i>should</i> do. The things they said made a lot of sense (especially the notion of Skinny Controllers &#8211; Fat Models), and reminded me that I should probably spend more time learning best practices from <a href="http://www.therailsway.com/">The Rails Way</a>.<br />
<i><a href="/blog/wp-content/uploads/2007/09/keynote-best-practices.txt">Download notes</a></i></p>
<p><b>Building Webapps in Europe: Economy, Methodology, and Tips</b><br />
<a href="http://www.workingwithrails.com/person/4830-nicolas-paton">Nicolas Paton&#8217;s</a> was a bit disappointing to me, as most of the things he said was pretty much common sense. I hold a lot of sympathy for the guy though, as his nervousness was quite visible during his talk &#8211; and thumbs up for bringing attention to differences between development in US and Europe.<br />
<i><a href="/blog/wp-content/uploads/2007/09/talk-webapps-europe.txt">Download notes</a></i></p>
<p><b>Ruby on Rails Security</b><br />
Heiko Webers of <a href="http://www.rorsecurity.info">RoRsecurity.info</a> brought our attention to potential security issues not only in our Rails code, but also in the web server and database. The biggest take-away from his talk for me, though, was his mention of three plugins: <a href="http://svn.techno-weenie.net/projects/plugins/white_list/">WhiteListHelper</a> for allowing only select tags in user-generated content, <a href="http://wiki.rubyonrails.com/rails/pages/Safe+ERB">SafeERb</a> reminding you to sanitize all your output of user-generated content and <a href="http://activeform.rubyforge.org/">ActiveForm</a>, which allows you to validate e.g. a search query using the ActiveRecord validators.<br />
<i><a href="/blog/wp-content/uploads/2007/09/talk-security.txt">Download notes</a></i></p>
<p><b>Browser-based Testing of Massive Ajax-using Rails Applications with Selenium</b><br />
I&#8217;ve known for a while now that I ought to improve my test base with <a href="http://www.openqa.org/selenium/">Selenium</a> tests, so <a href="http://www.workingwithrails.com/person/7300-till-vollmer">Till Vollmer&#8217;s</a> talk was a nice opportunity to get more into the testing framework. One of Till&#8217;s important points was that you&#8217;ll have to write your own test helper methods in order to get readable tests when testing massive Ajax applications like his <a href="http://www.mindmeister.com/">Mindmeister</a>. I also want to mention <a href="http://thefrontside.net/crosscheck/">Cross Check</a> of <a href="http://www.nealford.com/">Neal Ford&#8217;s</a> javascript testing talk in this context, as this application are able to emulate most known browsers &#8211; including their many bugs and differences!<br />
<i><a href="/blog/wp-content/uploads/2007/09/talk-selenium.txt">Download notes</a></i></p>
<p><b>Functional JavaScript Development with Prototype</b><br />
<a href="http://www.bennolan.com">Ben Nolan</a> managed to explain a lot of important javascript concept through his fast-paced tutorial. I for one didn&#8217;t know about javascript binding contexts before this talk, but it explained a lot of previous experiences to me! Whether you like Ben&#8217;s functional and very compact style when coding javascript, his tutorial was definitely enlightening and enjoyable.<br />
<i><a href="/blog/wp-content/uploads/2007/09/talk-prototype.txt">Download notes</a></i></p>
<p><b>Teaching Rails at a University</b><br />
While <a href="http://www.tzi.de/~cabo/">Carsten Bormann&#8217;s</a> about his course in agile web development using Ruby on Rails on a German university didn&#8217;t attract a very large crowd, those of us who was there were definitely glad to hear the news that it is possible to bring Rails into such old and dusty institutions as universities. I for one feel inspired to attempt to bring it into my own school, <a href="http://www.cbs.dk">Copenhagen Business School</a>, because really Ruby is much better suited as first programming language than Java and C#, I think.<br />
<i><a href="/blog/wp-content/uploads/2007/09/talk-university.txt">Download notes</a></i></p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2007/09/20/railsconf2007-notes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>RailsConf: The DHH keynote &#8211; Rails 2.0 update</title>
		<link>http://casperfabricius.com/site/2007/09/18/railsconf2007-dhh/</link>
		<comments>http://casperfabricius.com/site/2007/09/18/railsconf2007-dhh/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 15:35:25 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
				<category><![CDATA[deployment]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<category>iphone</category>
	<category>iphone</category>
	<category>patch</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/blog/2007/09/18/railsconf2007-dhh/</guid>
		<description><![CDATA[This article summarizes some important points from David Heinemeier Hansson’s keynote at RailsConf Europe 2007 in Berlin. Last year, DHH brought us the whole REST way of thinking which I immediately named normalization, but that term didn&#8217;t really catch on.

&#169; 2007 Pinar Ozger

This year, DHH noted that he up until now had started all his [...]]]></description>
			<content:encoded><![CDATA[<p>This article summarizes some important points from David Heinemeier Hansson’s keynote at RailsConf Europe 2007 in Berlin. Last year, DHH brought us the whole <a href="/blog/2006/06/25/railsconf-dhh/">REST way of thinking</a> which I immediately named <i>normalization</i>, but that term didn&#8217;t really catch on.</p>
<div class="photo left"><a href="http://flickr.com/photos/pinarozger/1401290307/"><img src="http://farm2.static.flickr.com/1140/1401290307_f8e971781c_m_d.jpg" alt="David Heinemeier Hansson" /></a>
<div class="caption">&copy; 2007 <a href="http://flickr.com/photos/pinarozger/">Pinar Ozger</a></div>
</div>
<p>This year, DHH noted that he up until now had started all his previous keynotes about Rails celebrating how &#8220;freakin&#8217; fantastic we are&#8221;. For this keynote, he thought &#8211; with Rails being well within in its third year in existence &#8211; that it was time to perhaps be happy with what we have.</p>
<p>He explained that new things tend to go through certain phases: First they ignore you, then they laugh at you, then they fight you, and then you win &#8211; &#8230; and then what? &#8220;Ruby on Rails went through these phases way too fast&#8221;, DHH said, &#8220;I was having a lot of fun going through these phases; I&#8217;m kind of sad it is over.&#8221;</p>
<p>For the last couple of years, David and the Rails community has pushing new concepts; Convention over configuration, AJAX and REST, but these focal points were adopted very fast, so there is no big cause to fight for right now. That leaves Rails 2.0 in a really weird spot, since it won&#8217;t have any groundbreaking new concepts.</p>
<p>This is not a bad thing, though, DHH stressed. &#8220;Even though [the lack of a great cause] is an off-switch for me, it&#8217;s not about me anymore&#8221;, he said. &#8220;Rails are moving from big revolutions to tiny evolutions&#8221; &#8211; a statement that was underlined when David went on to demonstrate new features in Rails; features that were definitely more tiny evolutions than big revolutions.</p>
<p>But before we get to the Rails 2.0 code examples of the keynote, let me just mention something that was news to me: The new policy for <a href="http://trac.rubyonrails.org/2007/9/15/how-to-get-a-patch-into-rails">how to get a patch into Rails</a>, also known as <i>Report #12</i>. The idea is basically that you, once you have written a patch and submitted it to the Rails trac, should get three other Rails developers to check out your patch, verify that your tests run, and then add a &#8220;+1&#8243; in a comment in trac. Once you have your three &#8220;+1&#8243;&#8217;s, you tag your patch with the keyword &#8220;verified&#8221;, and the patch will appear in <a href="http://dev.rubyonrails.org/report/12">Report #12: Verified Patches</a>. The core team should then &#8211; theoretically &#8211; be able to very fast to accept the patch into Rails.</p>
<p>Moving on to the, in my opinion, most interesting part of the presentation: What&#8217;s new in Rails 2.0 &#8211; show me the code! Migrations has been updated to support a new syntax known as &#8220;sexy migrations&#8221;, which basically allows even shorter and more readable migrations by grouping fields of the same type:</p>
<pre>
create_table :blogs do |t|
	t.string :title, :subtitle
	t.text :body, :description
	t.integer :category_id
	t.timestamps # Adds created_at and updated_at fields
end
</pre>
<p>Notice how another evolutionary improvement has been sneaked in: Tired of always adding <code>created_at</code> and <code>updated_at</code> timestamps to most tables, a <code>timestamps</code> method has been added as a shortcut. Also this new syntax, including the timestamps, is now standard in the <code>model</code> and <code>scaffold</code> generators.</p>
<p>A small, but to me significant improvement has also found its way to Rails 2.0: You can now create the needed databases with a rake command. By running this command, all referenced databases in your <code>database.yml</code> will be created:</p>
<pre>
rake db:create:all
</pre>
<p>Another interesting, and perhaps generally quite invisible improvement, is that session data are now stored in a encrypted cookie instead on each server, which makes it easy to partition applications across multiple servers without having to put session data in the database. This requires, of course, the session data to be quite compact (storing id&#8217;s, not entire objects), as a cookie can contain 4 KB of data the most.</p>
<p>My favourite point of DHH&#8217;s keynote was his solution to the common pattern of a resource, which you both need to display to the common user (usually <code>index</code> and <code>show</code>) and to the admin user (usually <code>index</code>, <code>new</code>, <code>create</code>, <code>edit</code>, <code>update</code> and <code>destroy</code>). The normal RESTful solution to this leaves with a problem, because we are only allowed one <code>index</code> action, and we need two; one for the common user and one for the admin user. Also, the admin actions will usually have a different layout than the common user actions, and they require some kind of authorization.</p>
<p>The solution is to used RESTful <i>namespaced</i> routes, referring to <i>two different</i> controllers with the same name, but in different namespaces. To use DHH&#8217;s eternal blog example:</p>
<pre>
./script/generate controller posts # => /controllers/posts_controller.rb
./script/generate controller admin::posts # => /controllers/admin/posts_controller.rb
</pre>
<p>Now we have two different controllers working in the same model; <code>Post</code>, but offering different actions, layouts, authorization and so on. This nice thing about this solution, is that it is very easy to understand and fits well into the Rails structure. The catch is that we have two controllers with the same name, so we need to explicitly express the namespace when referring to the admin controller:</p>
<pre>
form_for([:admin, post]) do |f|
	...
end
</pre>
<p>DHH also pointed out that HTTP authentication is a perfect way of doing authentication for administration pages (which <a href="/blog/2007/08/19/three-rails-plugins/">I&#8217;d already realized</a>). You don&#8217;t really need nice-looking form-authentication and <i>remember me</i> checkboxes for that, and it is so very easy to implement with Rails 2.0:</p>
<pre>
# In a controller or module shared between admin controllers
before_filter :ensure_administrator
def ensure_administrator
	authenticate_or_request_with_http_basic('Blog admin') do |username, password|
		username == 'dhh' &#038;&#038; password == '123'
	end
end
</pre>
<p>A very visible change in Rails 2.0 is the naming of views. The <code>.rhtml</code>, <code>.rxml</code> etc. file endings has been discarded to replaced by the form <code>[name].[mime-type].[renderer]</code>. This leaves the road open for file names such as:</p>
<ul>
<li>index.html.erb</li>
<li>index.xml.builder</li>
<li>index.html.liquid</li>
<li>index.iphone.erb</li>
</ul>
<p>The last example needs a little additional configuration, since <code>iphone</code> is not a &#8220;real&#8221; mime-type, but we can easily make Rails treat it like such:</p>
<pre>
# In mime_types.rb:
Mime::Type.register "application/x-iphone"

# In application.rb:
before_filter :adjust_format_for_iphone
def adjust_format_for_iphone
	if request.env["HTTP_USER:AGENT"] ~= /iPhone/
		request.format = :iphone
	end
end

# In specific controllers
respond_to do |format|
	...
	format.iphone do
		render :text => 'Hello iPhone', :content_type => Mime::Html
	end
end
</pre>
<p>Notice how <code>content_type</code> must manually be set to <code>Mime::Html</code>, as the iPhone browser &#8211; as well as any other browser &#8211; doesn&#8217;t recognize our fake <code>x-iphone</code> mime-type, and Rails will always default to respond with the request mime-type.</p>
<p>My second favourite point was about the &#8220;new&#8221; debugging support in Rails 2.0. As I understood it, the well-known ruby-debugger library has been baked into Rails 2.0, so that we write <code>debugger</code> instead of <code>breakpoint</code>, and need to start the server with a <code>--debugger</code> prefix (<code>./script/server --debugger</code>) to enable these breakpoints. This debugger also support more advanced commands such as &#8220;cont&#8221; (continue), &#8220;list&#8221; (view current code) and &#8220;up&#8221; (step out).</p>
<p>David Heinemeier Hansson rounded off his keynote by announcing the release of a <i>Rails 2.0 Preview Release</i> (how Microsoft-ish does <i>that</i> sound?) either during or shortly after the conference.</p>
<p>You can download my full notes from the keynote <a href="/blog/wp-content/uploads/2007/09/keynote-dhh.txt">here</a>.</p>
<p>UPDATE: My other notes from RailsConf Europe 2007 <a href="/blog/2007/09/20/railsconf2007-notes">are now available</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2007/09/18/railsconf2007-dhh/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>RailsConf: The Art in Rails</title>
		<link>http://casperfabricius.com/site/2007/09/17/railsconf-the-art-in-rails/</link>
		<comments>http://casperfabricius.com/site/2007/09/17/railsconf-the-art-in-rails/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 20:54:17 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<category>railsconfeurope2007</category>
	<category>railsconf</category>
	<category>europe</category>
	<category>2007</category>
	<category>art</category>
	<category>poet</category>
	<category>engineering</category>
	<category>dave</category>
	<category>thomas</category>
	<category>paint</category>
	<category>portrait</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/blog/2007/09/17/railsconf-the-art-in-rails/</guid>
		<description><![CDATA[
Dave Thomas officially kicked off RailsConf Europe 2007 in Berlin with his keynote; The Art in Rails.  He was fast to point out the fact that he, during the first ever RailsConf in Chicago last year, made major mistake talking about Rails itself, and that he hadn&#8217;t done that at a RailsConf since then.
Dave [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/zenoc/1399190094/"><img src="http://farm2.static.flickr.com/1283/1399190094_6033de71e4_m_d.jpg" alt="Dave Thomas" align="right" /></a></p>
<p>Dave Thomas officially kicked off RailsConf Europe 2007 in Berlin with his keynote; The Art in Rails.  He was fast to point out the fact that he, during the first ever RailsConf in Chicago last year, made major mistake <a href="/blog/2006/06/23/railsconf-dave-thomas/">talking about Rails itself</a>, and that he hadn&#8217;t done that at a RailsConf since then.</p>
<p>Dave Thomas went on to reinforce a point he, and many others, has made before; that software engineering is like art, and that the programmer is like a poet. Like a poet, a programmer can suffer from a writers block, and the best way to get out of that is to use prototyping. He pointed out exploratory testing as his favorite way of doing prototyping; a way of realizing prototypes through unit tests and mock objects.</p>
<p>His two other major points about the programmer as a poet was that you have to know when to stop, and that you must satisfy the customer. For the former, he stressed modularization and iterations as perfect ways for breaking up the development process into fixed pieces of functionality, and into a fixed amount of time.</p>
<p>For the latter, Dave Thomas explained the difference between taking a picture and making a portrait for artists. Painters rarely just paint a person reflecting the reality exactly as it is; they try to look deeper into that person and let his or hers personality into the painting &#8211; this process transforms the painting from merely a picture to an actual portrait.</p>
<p>The same thing goes customers of software projects. &#8220;We all need to get into the habit of not listing to our clients&#8221; Dave Thomas said, meaning that we need to dig out the customer&#8217;s real needs by looking beyond the surface and always ask why, why, why?</p>
<p>Finally the notorious author and speaker made the point that there is art in engineering, ad engineering in art. Ruby is the paint and Rails is the canvas. Dave Thomas urged everyone: &#8220;Treat your next project as if it was a work of art&#8221;:</p>
<ul>
<li>Be an Artist</li>
<li>Create Something Great</li>
<li>Create Something Beautiful</li>
</ul>
<p>You can download my full notes from the keynote <a href="/blog/wp-content/uploads/2007/09/keynote-davethomas.txt">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2007/09/17/railsconf-the-art-in-rails/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>RailsConf: People I met</title>
		<link>http://casperfabricius.com/site/2006/07/22/railsconf-people/</link>
		<comments>http://casperfabricius.com/site/2006/07/22/railsconf-people/#comments</comments>
		<pubDate>Sat, 22 Jul 2006 23:05:49 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
				<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<category>railsconf</category>
	<category>people</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/blog/2006/07/22/railsconf-people/</guid>
		<description><![CDATA[RailsConf was a blast. But I barely had the time to consume all the impressions, since my vacation was just after the event in Chicago. So I went directly to Roskilde Festival, North Europe’s biggest festival with 100.000 partying people near Copenhagen, Denmark, and from there I got on a bus to Rumania as part [...]]]></description>
			<content:encoded><![CDATA[<p>RailsConf was a blast. But I barely had the time to consume all the impressions, since my vacation was just after the event in Chicago. So I went directly to <a href="http://www.23hq.com/RSpace/photo/930359?album_id=930202">Roskilde Festival</a>, North Europe’s biggest festival with 100.000 partying people near Copenhagen, Denmark, and from there I got on a bus to Rumania as part of choir singing Danish songs in the Rumanian churches. When I got back, I realized my blog had gained quite a lot of attention (at least compared to its very silent past), not at least my posts on <a href="http://casperfabricius.com/blog/2006/06/25/railsconf-dhh/">David Heinemeier Hansson&#8217;s</a>  and <a href="http://casperfabricius.com/blog/2006/06/24/railsconf-paul-graham/">Paul Graham&#8217;s</a> key notes. While 70 subscribers and 200 visitors a day doesn&#8217;t sound like much to some, it fills me with a certain amount of humility: &#8220;Surely people will expect my future to be of high professional quality and deep insight&#8221;, I think.</p>
<p>See, my problem is, that while I seem to do pretty good on referencing what really, really smart people say and adding a bit of my own pocket philosophy, I find it a wee bit harder to provide genuinely usable Rails knowledge on my own. I have plans for posts about my on-going experiences with <a href="http://dev.subimage.com/projects/substruct">Substruct</a>, and about my struggles with actually being RESTful when developing, but for now, as a way to scare most of my newly gained audience away again, I&#8217;ve decided to write a completely non-technical and probably quite un-insightful blog about some the great people I met at RailsConf.</p>
<p>Always taking the analytical approach to things, I have divided those people into two categories: The <strong>VIPs</strong> and the <strong>VFPs</strong>. The first are VIPs of the Rails community; key note speakers, widely read bloggers, authors, etc &#8211; people I wanted to meet because I admired they work, but who won&#8217;t actually remember they met me afterwards. The second are some of the Very Friendly People I met at the conference, that is; people that I didn&#8217;t know beforehand, but that I ended of talking a lot to during the event. Of course the VIPs where also friendly, and the VFPs are probably also important (to some people), but most likely being a clever geek, I&#8217;m sure you get the idea.</p>
<p><strong>VIPs</strong></p>
<p><a href="http://www.loudthinking.com/">David Heinemeier Hansson</a>: Of course everybody at the conference wanted to meet DHH, and my twist was supposed to be to surprise him by talking Danish to him. In fact I happened to be talking to David Black when DHH came along, and Black was so kind as to introduce us and <a href="http://flickr.com/photos/casperfabricius/173492064/">take our picture</a>, but there wasn&#8217;t any time to talk further, so I can&#8217;t say I have any insight on DHH I can share.</p>
<p><a href="http://topfunky.com/">Geoffrey Grosenbach</a>: I had a great deal of respect for Geoff because of this persistent work with the Ruby on Rails podcast and his many insights about deploying, so I really looked forward to attending this talk and meeting him. It was strange to look at the guy and hear his unique voice I knew so well from the podcasts; kind of like meeting some one talking like Darth Vader.</p>
<p><a href="http://www.slash7.com/">Amy Hoy</a>: Amy is &#8211; literally speaking &#8211; a colorful part of the Rails community. Probably the most well-known girl in the community and the only female speaker at the conference, I of course had to meet her. I did, and she willingly lined up for a <a href="http://flickr.com/photos/casperfabricius/173491972/">photo</a>. What I don&#8217;t like about Amy is that she keeps reminding me that good &#8211; and fun &#8211; writing is hard work, and I just don&#8217;t have the patience to rewrite a sentence five times like she does, which means that my blogs will never match hers in enjoyability, I&#8217;m afraid.</p>
<p><a href="http://dablog.rubypal.com/">David Black</a>: I meet Black at &#8220;day 0&#8243;, where I didn&#8217;t get to participate in the Guidebook session, so I went early into the room reserved for improvised events, where he sat all by him self with his Mac. I didn&#8217;t know who he was &#8211; in fact, I thought he looked completely wrong in the setting (remember, the conference wasn&#8217;t started yet, and I hadn&#8217;t yet realized that Ruby gurus generally <a href="http://flickr.com/photos/casperfabricius/173492056/">mature, bearded men</a>), but he explained to me that he was the organizer. Later that day, I bought Black&#8217;s book in Chicago and got it signed by him &#8211; nice!</p>
<p><strong>VFPs</strong></p>
<p><a href="http://sflickr.org/">Tim Trautmann</a>: Migrated from Germany, <a href="http://flickr.com/photos/casperfabricius/173024762/">Tim</a> was the closest thing to a European I got to know at the conference. We enjoyed a <a href="http://flickr.com/photos/casperfabricius/173024629/">nice dinner</a> Friday, and he was part of the <a href="http://flickr.com/photos/casperfabricius/173859426/">drinking buddies</a> sitting outside the bar. Tim is a consultant, having a one-man company with a funny name I seem to have forgotten.</p>
<p><a href="http://somebox.com/jeremy">Jeremy Seitz</a> &amp; <a href="http://flickr.com/photos/casperfabricius/174562197/">John</a>: When I realized that nothing was going to happen at &#8220;day 0&#8243; besides the Guidebook, I went to Chicago. I met <a href="http://flickr.com/photos/casperfabricius/173024501/">Jeremy and John</a> waiting for the shuttle bus, and we ended up buying a brand new <a href="http://flickr.com/photos/casperfabricius/173024282/">Macbook for John</a> at the Chicago Apple Store. I can&#8217;t seem find John&#8217;s last name or blog, but both of J&#8217;s was great fun to hang out with through out the conference days.</p>
<p><a href="http://softiesonrails.com/">Brian Eng &#038; Jeff Cohen</a>: Meeting the Softies was definitely one of my goals at the conference since I really like their blog, and they turned out to be <a href="http://flickr.com/photos/casperfabricius/174562191/">extremely friendly</a> and great company. These guys actually works in cubicles like they do in Dilbert (which only seems to amusing to Europeans), so you&#8217;d think they be grumpy and bitter, but they where all smiles and even paid for our dinner at Chilies &#8211; I owe you one, guys!</p>
<p><a href="http://rubycocoa.sourceforge.net/">Hisa</a>: This cool Japanese actually wrote the RubyCocoa framework, which I definitely want to try out once I get my hands on a Macbook, and we talked many times during the conference. Hisa wasn&#8217;t bothered about his English being a bit rusty, and a really funny thing he explained to me, was that he found it just as to distinguish between western people, as we often find it to distinguish between Asians. Fair enough!</p>
<p><a href="http://jimonwebgames.com/">Jim Greer</a>: Once the conference ended Sunday afternoon, Jim was one the people that &#8211; like me &#8211; was staying at the hotel till Monday. A minor <a href="http://flickr.com/photos/casperfabricius/175166456/">hack fest</a> formed in the bar that evening, and I sat opposite to Jim, writing on <a href="http://casperfabricius.com/blog/2006/06/25/railsconf-dhh/">my blog about DHH&#8217;s key note</a>. I discussed the whole normalization issue with him, and this actually inspired Jim to start up his blog and write <a href="http://jimonwebgames.com/articles/2006/06/26/dont-say-crud-say-fucd">his first post</a>, which was later referenced in <a href="http://www.loudthinking.com/arc/000593.html">DHH&#8217;s blog about the issue</a>. Jim is starting a web game company in England, and I&#8217;m pretty sure he will be a success.</p>
<p><a href="http://violasong.com">Victoria</a>: I had a great conversation about everything from the Rails community to the differences between USA and Denmark with one of the <a href="http://flickr.com/photos/casperfabricius/175166383/">very few girls at RailsConf</a>, while I was trying to spot James Adams, the creator of Rails Engines, with out any luck. Victoria was attending the 37signals workshop the following week, and I believe she promised to blog about it&#8230;</p>
<p>I met plenty of other nice and friendly and important people, but this has to end some where. I wish I could finish telling you how I much I look forward to RailsConf 2007 and seeing some of these people again, but the fact is that it&#8217;s very unlikely that I&#8217;ll be there. The conference is in May, and I&#8217;m in school &#8211; what do you do in school in May? You have exams. Tough break.</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2006/07/22/railsconf-people/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>RailsConf: Create, Read, Update, Delete: Normalize</title>
		<link>http://casperfabricius.com/site/2006/06/25/railsconf-dhh/</link>
		<comments>http://casperfabricius.com/site/2006/06/25/railsconf-dhh/#comments</comments>
		<pubDate>Mon, 26 Jun 2006 04:10:36 +0000</pubDate>
		<dc:creator>Casper Fabricius</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[railsconf]]></category>

	<!-- AutoMeta Start -->
	<category>railsconf</category>
	<category>David</category>
	<category>Heinemeier</category>
	<category>Hansson</category>
	<category>rest</category>
	<category>active</category>
	<category>resource</category>
	<category>normalization</category>
	<category>normal</category>
	<category>form</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://casperfabricius.com/blog/2006/06/25/railsconf-dhh/</guid>
		<description><![CDATA[(Looking for DHH&#8217;s keynote at RailsConf Europe 2007? Find it here)
I’d been looking forward to David Heinemeier Hanssons (DDH) key note in the same way I’m guessing people looks forward to hearing Bill Gates and Steve Jobs talking at the big Microsoft and Apple conferences. Any community needs its mythical founder amongst whom the community [...]]]></description>
			<content:encoded><![CDATA[<p><small>(Looking for DHH&#8217;s keynote at RailsConf Europe 2007? <a href="/blog/2007/09/18/railsconf2007-dhh/">Find it here</a>)</small></p>
<p>I’d been looking forward to David Heinemeier Hanssons (DDH) key note in the same way I’m guessing people looks forward to hearing Bill Gates and Steve Jobs talking at the big Microsoft and Apple conferences. Any community needs its mythical founder amongst whom the community can revolve, and DHH makes a good job of filling that role, backed up by wise men such as the Fowlers and the Pragmatics.</p>
<p>DHH had just returned from a trip to a Ruby conference in Japan, and &#8211; still very much jetlagged, as he explained later that evening in the bar &#8211; introduced the topic of his key note: CRUD. Create, Read, Update, Delete. An idiom so widespread that they even teach it in my Java-centric school, an abbreviation that lays out the four basic operations of manipulating database tables. DHH explained that he has lately started seeing all his code in the light of CRUD, in fact, he starts to spot “crudness” everywhere – perhaps CRUD can be used as the basic pattern for making beautiful code?</p>
<p>DHH pointed out the similarities between CRUD, database operations, Rails actions and – last but not least – the http methods:</p>
<ul>
<li>Read, <code>SELECT</code>, <code>find</code> and <code>GET</code></li>
<li>Create, <code>INSERT</code>, <code>create</code> and <code>POST</code></li>
<li>Update, <code>UPDATE</code>, <code>update</code> and <code>PUT</code></li>
<li>Delete, <code>DELETE</code>, <code>destroy</code> and <code>DELETE</code></li>
</ul>
<p>When you browse to a url like <code>GET /people/show/1</code>, you are basically repeating yourself: <code>show</code> is redundant, because the http method sent by the browser has already specified that you want to do a <code>GET</code>. So the beautiful version of the url would be <code>GET /people/1</code>, just as <code>PUT /people/1</code> is more beautiful than <code>POST /people/update/1</code>.</p>
<p>The problem is, however, that even though the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html">http protocol</a> specifies all of the mentioned methods, only <code>GET</code> and <code>POST</code> has achieved wide spread use, and thus, specifying <code>PUT</code> or <code>DELETE</code> as the method on a form tag won’t work as intended, since browsers just ignores it and defaults to <code>GET</code>, and if even if it is capable of passing the method on, many web servers and proxies sees the use of methods like <code>PUT</code> and <code>DELETE</code> as unsafe and rejects them. No problem, DHH said, we’ll just fake it in Rails using a hidden field to specify <code>PUT</code> and <code>DELETE</code> methods. This should raise some alarm bells, he continued, and it certainly did with me. By using a hidden field I get ugly flashbacks (well, wish they were flashbacks, I’m still doing loads of .NET) to the heavy use of hidden fields in .NET which result in 500 KB pages &#8211; excluding images – so asked, at the Rails Core Q&amp;A session, if this wasn’t a slippery slope taking Rails in a wrong direction?</p>
<p>No, DHH answered without hesitating, we’ve done plenty of things that could be a slippery slope before. It’s a hack, and we might be able to take it away eventually, but right now it’s the way to go. I guess I’ll just have to try it out, since the Simply Restful plugin, which promotes this kind of urls, will be implemented in Rails 1.2, according to the Rails Core team (and they should know it).</p>
<p>Tightly connected to the point about restful urls, is DHH’s newly found desire to promote controllers that only do the four CRUD operations. Basically, he argues, if you have more than the default actions in a controller; index, show, list, new, create, edit, update and delete, you haven’t thought enough how to structure your controllers and actions. If have “scoped” actions like <code>add_user</code> or <code>post_comment</code>, you haven’t “crudified” your application, and you should move those actions to a <code>UserController</code> or a <code>PostController</code>.</p>
<p>As I discussed later with <a href="http://violasong.com/blog/">Victoria</a>, many of the brilliant people at RailsConf are self taught college drop outs doing cool projects their own way, instead of worrying about learning the “right way” at school. But with this “crudness” or “crudiness” DHH wants the controllers to respect, I actually think he is trying to phrase a concept both of us learned about, while getting our bachelor&#8217;s degree in Business Administration and Computer Science at the Copenhagen Business School: <a href="http://en.wikipedia.org/wiki/Normal_form">Normal form</a>. Normal form is known concept throughout logic, language and mathematics theory, but from my education, I know it from database theory. It’s all about optimizing your database by <i>normalizing</i> your tables into a certain normal form, and I’d guess that’s what DHH wants us to do: To normalize our controllers.</p>
<p>I realize DHH is not too interested in databases – during the Rails core team Q&#038;A he said in fact: “I don’t like databases. I pretty much use them as hashes.” – but I like the analogy, and I propose we start talking about normalization in this context, because really, normalization is just another word for beauty. However, beauty is a bit unspecific and it’s widely used to describe anything <i>good</i> in Rails, so why not instead say: I’ve normalized my controllers and action to the CRUD normal form. There are in fact things we can learn from traditional school paradigms such as relational algebra or object oriented design, or maybe it’s just general programming wisdom which has some how snuck into education, and one of those things is this: “If you think about it a bit harder, a simpler approach will appear.” (DHH). You do this when you normalize databases. You do this when draw UML diagrams. And now you should do it when you normalize controllers – think simpler, think CRUD!</p>
<p>But: CRUD is not a goal in itself, it’s an aspiration, a design technique, DHH emphasized, and normalizing (“crudding”) won’t be the answer to everything. Basically though, you can normalize anything, and DHH gave examples with the state of case having its own model and its own controller – this way, the <code>CaseController</code> was normalized, and didn’t have to had any <code>add_state</code> actions or something like that – instead, these actions was implemented in the <code>StateController</code> through the standard CRUD actions. At first, DHH explained at the Rails Core Q&amp;A, he thought login was an example of actions that couldn’t be normalized, but Jamis Buck had the solution for this, implementing CRUD actions on a <code>SessionController</code>, since that’s basically what a login does; adding and removing stuff in the session.</p>
<p>Enough with the theory. The big revelation of the key note was a new API DHH started hacking away at two days before the key note; Active Resource. The API is basically all about describing things as resources, and as I understand it after discussing it with Geoffry Grosenbach and Chris McGrath, it’s basically an alternative to Action Webservice based on the <a href="http://en.wikipedia.org/wiki/REST">REST</a> concept. Since it’s still work in progress, I’m not really sure it’s going to work at all, but it seems like it will usable for both <i>providing</i> an API as well as <i>consuming</i> it. I guess DHH don’t want to repeat the work on the Basecamp API now that he is doing Sunrise, but also, he wants to emphasize that almost anything can be viewed as a resource. Active Resource will be released as a small, compact plugin as part of Rails 1.2.0, and basically, it sounds like that release will very much focus on the REST principles, and on making the Rails core smaller by pulling thing out in plugins.</p>
<p>The example DHH gave on using Active Resource was based on his notion on viewing XML basically as a hash. So perhaps your code would look like this:</p>
<pre>
Person = ActiveResource::Struct.new do |p|
	p.uri “http://www.example.com/people”
	p.credentials :name => “dhh”, :password => “secret”
end
matz = Person.find(1)
</pre>
<p>- and Active Resource will automatically wrap the XML response, which could look like this:</p>
<pre>
&lt;person&gt;
	&lt;name&gt;Matz&lt;/name&gt;
&lt;/person&gt;
</pre>
<p>For now, we’ll just have to wait and see what turns up in Edge Rails and try it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://casperfabricius.com/site/2006/06/25/railsconf-dhh/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
