Ruby Nation 2009 - First Day

Last year, I attended the Ruby Nation conference in DC. It was a great conference that felt like a breeze of fresh ideas. As I sip my coffee waiting for the first speaker to kick off this year’s edition, I am hopeful that it will inspire the 150 developers that signed up for the event, the same way as it did in the past.

Preparing for Ruby 1.9
Ok, I don’t have ruby 1.9, since Apple still ships 1.8.6. Download source, configure, make and in 5 minutes I have it running on my Mac. This is the beauty of the open source revolution.

Features discussed by David Black that I like:

  • Scratch variables in blocks eliminate fear of clobbering another variable outside the block:
    [1,2,3].each {|n;x| x=n*10; puts x}
  • String encoding can be viewed or changed on the fly
  • String is not enumerable anymore, but it has methods that are:
    "I like Ruby".chars {|c| puts c}
  • Cyclic enumerations:
    ("a".."z").cycle{|c| puts c}
  • Eigenclass has published a comprehensive list of Changes in Ruby 1.9.

Design Patterns In Dynamic Languages

Before the conference started, I had a chat with Russ. We quickly came to the conclusion that old school thinking and coherent software development is alive and kicking. Design patterns is one of those things that you should pay attention to.

With that being said, 34000 books have been written about design patterns (as searched on Amazon). It is a challenge to to extract the gist of why we need design patterns, and this is how Russ put it:

Design patterns allow to extend the space of what a programming language can natively do. For example, it can describe a loop in Assembly or a class factory in Java.

In Ruby, Java patterns can stay the same, disappear or morph:

  • The patterns that stay the same, can sometimes be implemented more efficiently in Ruby. This code will give you a head start by transparently calling all the methods of the wrapped object:

    def method_missing(method, *args)
    real_object.send(method, *args)
    end
  • Patterns like Singleton may disappear. In Ruby, it is implemented as a module:

    class MyClass
    include Singleton
    end
  • Ruby can specify the acceptable behavior for an object at runtime, so selecting a specific class isn’t the only way to have the right behavior. For example, the belongs_to macro-like method in ActiveRecord, adds methods needed to access the associated record.

There is no final word in technology. Patterns should evolve and adapt to new realities.

Comics is Hard: Domain Modeling Challenges

What does the biological taxonomy, comic books and social networking have in common? They are difficult to model using a relational database. Consider some alternatives when facing this kind of challenge:

  • Column-oriented databases such as Apache Cassandra
  • Document-oriented databases such as CouchDB
  • Graph-based databases such as Neo4j

Reia: The Next Big Thing?

Object Oriented programming and Functional programming may converge into some unified language. It is too soon to tell what that language will look like, but Reia can provide some insights. Reia combines Ruby and Erlang to create a functional, distributed and object oriented language. It is still work in progress but worth trying.

Lightning Talks

Rails on JRuby: deploying Ruby on Rails in J2EE application containers

Static Types in Ruby: Diamondback Ruby

In-House IT Perspective: Understand the domain knowledge to speak the business language with your customers.

Java Swing in Ruby: Pass behaviors instead of subclassing Actions. Also take a look at clojure.

specMSMS allows to upload, analyze, share and compare data (bioproximity.com)

Help to build a more transparent government by joining civic coders: Sunlight Foundation, Twitter: @LuigiMontane and @sunlightlabs

‘Handling’ Legacy Databases with Rails and DataMapper
Datamapper is a great piece of technology to access relational databases. I used it myself to interface QuickBooks with SugarCRM and I appreciated its flexibility to access a legacy database.

The Passionate Programmer

A blog can’t do justice to Chad’s presentation. You need to listen to his talk, or even better, buy his book The Passionate Programmer.

2 Responses to “Ruby Nation 2009 - First Day”

  1. David A. Black Says:

    Hi –

    A quick tweak: String#chars and friends are iterators, so you don’t need each; you can just do: str.chars {|c| p c } etc.

    David

  2. skaczor Says:

    This is even better (another point for Ruby).