RailsConf Keynote: David Heinimer Hanson

Short Version: Think before you code. If you think clearly about your domain problem – the answer is much simpler.

!http://static.flickr.com/66/174165944_3e34fa58a3_m.jpg!:http://flickr.com/photos/kastner/174165944/

Before DHH’s keynote, rails conf 2007 was announced:

RailsConf 2007 will be done in partnership with O’Reilly & Associates!
may 17th-20th in Portland, OR

DHH talks about his very strong opinions. About bending the outside world to our way, not the other way around.

In “The Real World” You’re weighed down by decades of practices.

The Japanese version of Agile Web Dev sold over 7,000 copies in the first few weeks.

43 Things does 3.5 million rails page views a day now.

h3. Create Read Update Delete (CRUD!)

It is the baseline of most of the work we do in the Rails world.
What they told you about CRUD:
* Simplistic
* Unfulfilling
* Unworthy
* Shameful

but *THEY WERE WRONG*

h3. “How I learned to stop worrying and love the CRUD”

His old way of doing things

POST /people/create
GET /people/show/1
POST /people/update/1
POST /people/destroy/1

This makes him queasy now
His new ideal:

POST /people
GET /people/1
PUT /people/1
DELETE /people/1

The problem with the new way is, even though it’s part of the HTTP Spec, it doesn’t translate well to HTML.

ActionController::Routing::Routes.draw do |map|
map.resources 'person'
end

Rails is all about making a magical world where things just apply – like mapping HTTP verbs not used very much. Even though HTML doesn’t do it, RAILS does (1.2)!

By using a hidden value, @:method => :put@ becomes @input type=”hidden” name=”_method” value=”put”@.

h4. Why Bother?

It’s a lot of work. Why should Rails go through all the trouble of making this work right?

Reasons:
* Consistency
Some of DHH’s code for controllers are a bit of a mess. Sprawling is the right word.
The more decisions you can take out, the more you can get done.
* Simplicity
* Discoverability

h4. Constraints are liberating

The real power of crud is building our your DSL(Domain Specific Language)
With the new ideas – you can do many to many’s for free. Updates, etc.

Which gets us to “Memberships”

h3. “If you want to indulge in insanity, it should HURT” – DHH.

h3. CRUD is not a goal, it’s an apiration – a design technique.

15 actions in a controller is way too many.

h3. Simply RESTful

by using the extension of the request, you can “force” mime-types. Not just for GETs but POSTs as well

h3. Active Resource

2 thoughts on “RailsConf Keynote: David Heinimer Hanson”

  1. Man, you really need to talk about ActiveRecord… that was by far the coolest part of the talk. That, and the memcached that Scott/Simon talked about yesterday, really starts making me think about breaking down the object walls between different programs, so that code objects can move around from site to site and program to program to wherever they’re needed.

    It’s a cool future, I hope we get there.

Comments are closed.