acts_as_conference 2008 : Best Practices for Rails Teams

Brian LeGros | February 9th, 2008 | conferences  

Luke Francl, from SlantWise Design, gave the 2nd presentation of the day on Best Practices for Rails Teams. He went into common problems that any Rails shop with 3 or 4+ developers have to address. I didn’t get much out of the presentation since I’ve spent the majority of my career trying to solve these issues, but a lot of people were attentive and the Rails twists did peek my interest; migration conflict resolution was very interesting. Luke did a great job referring to some classical and popular texts for project management and had even had a detailed hand out, so he was definitely prepared.

It’s always good to see people pushing good SCM and PM practices in a community. Keep up the great work Luke.

acts_as_conference 2008 : Advanced DSL’s in Ruby

Brian LeGros | February 9th, 2008 | conferences  

Yesterday morning I skipped the charity session, not because I hate charity, but in favor of getting some work done at the office before the conference. For me the first session was Neal Ford’s presentation on Advanced DSL’s in Ruby. Neal works for ThoughtWorks where they have being using Ruby to build internal DSL’s for customers with some success. He focussed his presentation around a Bakery example, but more importantly, while doing so was able to convey a set of patterns that they’ve found useful while building DSL’s (mainly internal DSL’s).

  • Went over good uses for method chaining and nested method as they apply to creating/maintaining an object’s state (Good Citizen pattern).
  • Spoke about benefits of using method/property aliases as a cheap way to provide clarity (e.g. – gram() and grams() do the same thing)
  • Detailed the Type Transmogrification pattern and the Constant Missing Factory pattern and the benefits of using “open” classes (e.g. – missingMethod and missingProperty methods) to avoid cluttered implementation classes that provide flexible interfaces.
  • Talked about using context to reduce code noise within the DSL itself.
  • Went into the Bubble Word pattern which provides “empty” semantics allowing the DSL to be more expressive but helping to simplify the DSL’s implementation.

Neal also spoke about external DSL’s a bit getting into an Expression Builder pattern which gives a good context for good practices as far as parsing DSL strings go. One thing that was reassuring to hear was the discouragement of complicating DSL strings with the intention of using regex to reduce complexity. I’m regex stupid, so whenever someone tells me they’ve been successful by taking simpler approaches, I’m always happy.

This by far was the best presentation of the day, IMO. Recently I’ve been working on a mock object library for ColdFusion and a lot of the topics Neal mentioned in his talk resonate with me as a good basis for solidifying my ideas for the library. ColdFusion lacks the majority of the great meta-programming features that a Ruby or Groovy would have, but I’ve some ideas up my sleeve. Great work Neal! I really enjoyed the talk.