Sunday, June 08, 2008

RailsConf 2008 - Day 2

Day 2 of RailsConf 2008 began with a keynote from Jeremy Kemper, uber-committer and now main man behind Ruby on Rails. According to the brief introduction by DHH, Jeremy did around one third of the Rails 1.0 release himself, cares deeply about the "whole thing", and has been busy helping get RoR running on Ruby 1.9 and other platforms.

That must explain why Jeremy kept yawning incessantly during his presentation... he is the reason DHH is able to get more sleep! There was some speculation that Jeremy was actually suffering from a hangover... I have no idea, I was asleep the night before.

Anyhow, Jeremy gave an overview of going from Rails 1.0 to the new 2.1 release. Basically, in his opinion 1.2 was "out for a while and got stale". In 2.0, we got all these foxy and sexy things, plus shed a lot of fat and gained speed. But the real story was the growth of the movement behind Rails from a fairly small group of core people, to a massive community of interested contributors. Here are some amazing stats:

From the 2.0 release in Dec 2007 to the 2.1 release in June 2008

> 1400 contributors (Trac, Lighthouse, and Github users combined... obviously a bunch are duplicates, but even 450+ is a large number!)
> 1600 patches
> 9000 comments

I cannot imagine the chaos of having THAT MANY people harassing me over getting their pet patches into the Rails trunk. No wonder they seem a little preoccupied... they are actually thinking about how many patches that will have to reviewed by later tonight! Much respect to the team just for dealing with that many crazed developers. This is to a large extent the key benefit of moving RoR on to Github: the much easier process of managing all these people's contributions.

Here are a few brief highlights of the new 2.1 features:

* New merged migrations - helps deal with keeping migrations synched throughout the development team. It does this by a new naming system, and now making sure that all unapplied migrations have been handled, instead of the old simple schema_info table, RoR now keeps track of all migrations, and makes sure that all migrations have been applied

* Time zone support - there were several plugins for time zone support. RoR has now included a fairly simple way of handling this with some baked in logic that extends both the Time class as well as some new ActiveSupport hotness.

* Ruby gem dependencies - now you can specify exactly which gems and versions are needed for your Rails app, instead of playing "one of these gems is not like the others" when trying to install or deploy a Rails app.

* Memcache - support for the ultra powerful memcache is now baked in, making fragment caching work nicely... made memcache a first class member of framework, and the memcache client is now bundled with the code distribution.

* ActiveRecord Dirty - now a way of track what has changed in a AR instance. This improves performance slightly by eliminating unnecessary database writes, but even more importantly results in much cleaner log files.

* Smarter :include - avoids combinatorial explosion with out of control includes, that result in too many left outer joins on every DB access. Instead, will just perform two queries to DB, with resulting database performance improvements. For example:

Msg.find(:all, :include => :user) # two queries
Msg.find(:all, :include => :user, :order_by => 'users.created_at) # uses outer join


* Named scopes - with complex models, you will have repeated convenience associations. For example:

user.recent_messages

You would prefer:

user.messages.recent

especially if you can pick it up "for free". Here is a tiny example:

class User
has_many :messages
...
end

class Messages
named_scope :recent, :order => 'created_by DESC'
...http://www2.blogger.com/img/gl.link.gif
end


An Embarrassment Of Riches In Ruby VM-land
Rails is now running in (milestone achieved just before the conference, thanks to heroic efforts by John Lam, and the rest of what is a very under-appreciated team within the Ruby community at-large). Rails has been running in JRuby for months. Also, RoR has been running in Rubinius since about two weeks before RailsConf.

And adding to the fun, Ruby 1.87 is now released, which includes a bunch of performance related backports from the once and future Ruby 1.9 release.

Just to show all of this multi-platform hotness, Jeremy did a little Rails 2.1 demo, showing the a minimal Rails app running on JRuby, Rubinius, and Ruby 1.9. That was amazing really, that we are actually here. Sure, Rubinius was kinda slow at starting up, but it worked, that is what counts.

Ruby 1.9 on Rails
Yes, you can actually run Rails on Ruby 1.9, at least somewhat. ruby-1.9 script/server

In Ruby 1.9, string encoding is huge change. According to Jeremy, 1.9 looks really fast... despite no formal benchmarks. He sees modest performance improvements on typical pages, and really notices it on bigger ERB pages. The typical page is about 20% faster. He says all rails tests are running on ruby 1.9.

Despite all of the yawning, I was not put to sleep at all by seeing some cool new Rails features, and even more importantly a few huge milestones in the Ruby VM race.

"Getting Git" - Scott Chacon
The keynote was good, but it had only whetted my appetite for even more substance. After a tip from a friend, I went to check out Scott Chacon's presentation on git. If you knew nothing about git, this was not the place for you. Scott really got into the internals of git, which many of us found captivating.

The room was pretty packed, and the crowd was held in rapt attention. Several of us remarked afterwards that it was the most organized presentation we had ever seen. It somewhat mimicked the format used during Dick Hardt's presentation on "Identity 2.0" at OSCON 2005, if you have seen that one. Each section of the presentation was precisely timed, and amount of material covered was massive. I took copious notes, but there was no way to try to capture that much info. Check it out online here, if you want to dive deeply into the glory that is git.


"Advanced RESTful Rails" - Ben Scofield

Next, I went to Ben Scofield's presentation on REST. Surprisingly a lot of people are not yet using REST. Or if they are, there appears to be some confusion over exactly how to implement things correctly. It was a decent presentation, but "Intermediate" would have been slightly more accurate. I mean, where was the discussion about polymorphic RESTful controllers? Now THAT would have been advanced.

It was still a good, if not great presentation. Ben knows what he is talking about, I would just suggest raising the bar as far as use of the word "advanced". That suggestion applies across the board to all RailsConf presentations.

"StoryRunner" - David Chemlisky

David Chelimsky is the closest thing we have to a test guru in the Ruby community. Here I am using the word guru in a precise way, "any person who counsels or advises; mentor". No single person has had as much impact on introducing best test practices like behavior-driven development to the Ruby community. Even the way that plain old test-driven development is done, is heavily influenced by RSpec. Not to mention the clones like Test::Spec and shoulda. All of the cooler projects I work on have test specs, and not just unit tests. The projects that I work on that are not as precisely thought out, turn out to not have test specs, but only unit tests.

Coincidence? I think not. The reason for going through the process of really defining what is to be done is to provide a common understanding between the people in the project. But if that was the whole story, BDUF might work. The problem is you need to apply test-driven development principals to the specifications themselves in your project, not just the code. And you need to be doing this as the project goes on, not just once in the beginning.

Behavior-driven development is about closing the gap between the "customer" (the system/site/application user, if you work in something other than a consulting firm) and the "developer" (that would be you). And that is where StoryRunner comes in.

StoryRunner makes it easy to create a kind of simple parser for a very english language oriented, simple text based way to write specs, requiring far less structure that the current RSpec format. It is really like a DSL that customers can use themselves to define their needs. As David put it, "Ruby code is very readable, but you will not be getting customers to send you emails with new requirements in the form of Ruby code."

So BDD is about helping the customer/user formalize their thoughts about exactly what solution they need. Can you imaging a future, where an initial RFP is put out in the form of test specs? That might provide a lot better basis for estimating, than the pages and pages of static docs that seem to still be getting cranked out inside large development organizations.

Have the requirements been changing? Just do a diff on the specs. There are so many advantages to this approach, that once you get the customer "spec-obsessed", just like developers who become "test-obsessed" the game is totally changed. You can't go back, at least willingly.

David talked about a couple of other tools that fit nicely in the RSpec stack. One very cool way to use it for full-stack integration testing is using Webrat. Another is doing true browser testing using Selenium-RC. David showed a demo of this, and remarked on how happy it made customers to be able to actually see their web site being tested, not just get the results back.

Note that RSpec is for use with Ruby, not just Rails, so if you are using Merb or Sinatra, or whatever, you can still write test specs using RSpec and StoryRunner.

Keynote - Kent Beck
During Chad Fowler's introduction, Chad said he was "like one of the superdelegates, getting to cast his vote about what we would get for presentations regardless of what we thought we wanted." All I can say is, Chad, keep it up. Some of these people might not get it, but if they continue to stay in this game long enough, they will.

At last, the moment I had been waiting for, and the biggest attraction for me personally in the RailsConf 2008 schedule: Kent Beck, one of the extremes, the Saturday night keynote.

Kent's presentation on the surface appeared highly informal, just a bunch of stories. It actually consisted of a serious of overlapping arcs on three topics that he knows a little about, because he helped create them: test-driven development, design patterns, and Extreme Programming. These stories took place over a 20 year timeline, stretching back to the origins of the work that the whole Rails community indirectly rides on today. This was before a bunch of RailsConf attendees were born, or at best were still in diapers.

I was pretty immersed in Kent's storytelling. I was too young to have been part of that original movement, but I'm old enough to want to learn all I can from the great masters, before they are all retired or just inaccessible. Amazing to have access to a couple of the extremes, like Ward Cunningham who was just hanging out on Day 1, at a fairly small conference like RailsConf, where most of the people do not even know who they are. For me, it is like a dream come true. If a bunch of other people are passing up the equivalent of intellectual caviar to stuff themselves with potato chips, well, good for them.

Enough ranting, back to Kent's "Tales to His Grandson". The unifying theme that emerged to me was that Kent is a true 60's radical who chose software as his weapon of choice to use in order to achieve social change. Like many great thinkers, Kent is a reader of books. Yes, those old things. Here are a few that he specifically mentioned that were instrumental in the development of his philosophies:

Christopher Alexander - "The Timeless Way Of Building"

Robert Mankoff - "The Naked Cartoonist: A New Way to Enhance Your Creativity"

Dr. Frank Luntz - "WORDS THAT WORK: IT'S NOT WHAT YOU SAY, IT'S WHAT PEOPLE HEAR"

The last question in the Q&A was really telling. When asked "do you think that you accomplished the political changes you set out to?" he responded that "No, he had not. And that he really did not fully understand why". Oh, those idealistic baby boomers! Kent, you may not have achieved all you set out to do directly, but the forces you set in motion are still going. Even though many of the attendees at RailsConf do not know you, they have grown up in a world where they expect more freedom and openness, and that is in part thanks to you, and fighting the good fight back then. Thanks, Kent, for staying true to the movement.

RailsConf - The Jam Session
After that very high level of intellectual brilliance, what could possibly top it off? How about a fantastic musical jam session. Chad had arranged the Musical BoF, and somehow Jim Weirich had talked a very generous and cool local music store into loaning him a perfectly playable acoustic guitar. Chad had his ukulele, Andrea Wright a recorder, and Dan Tripp, a portable folding guitar. I had brought a couple of my harmonicas with me, though not enough, of course. There were a bunch of other fun musical things, like a flute, and an impromptu Brazilian song or two from actual Brazilians. Not to mention a very creative approach toward an impromptu percussion setup by Forrest Chang.

Anyhow, great fun was had by all! We are already planning the RubyConf 2008 Jam, so it you will be coming, bring your ax! I will commit right now to the Dead Programmer Society helping sponsor having some instruments and/or PA system... plus some beer!

As I headed back to my room, I felt the smug contentment that comes from having had a really good time. Thanks everyone, for having made RailsConf 2008 "worth it" by the end of Day 2. Day 3 was still coming, and would have a few surprises of its own...

Wednesday, June 04, 2008

RailsConf 2008 - Day 1

As RailsConf 2008 - Day 1 began, there was no avoiding a sense of just how large the community was growing. With over 2000 attendees, the physical presence was bigger than ever. But, unlike the first two conferences, the growth of the community had triggered inexorable changes. Unbeknownst to most attendees at RailsConf 2008, a rebel alliance had formed itself. The caboo.se crew, longtime Ruby on Rails committers, had decided to stick it to the MAN. Or as Courteney put it:

In May, if you don't want to cough up almost a thousand dollars to go learn things you already know, but want to come to Portland to network with skilled Rails coders from all over the world, instead of hanging out in the lobby at the Lloyd Center like I did last year, come to Caboose Conf.


The spawning impulse must have been too great for the cool kids. They were heavily conflicted when O'Reilly took over for RailsConf 2007. Not being one of them, I can only surmise how they felt. But no one likes to pay for something that once was free. And it is unpleasant to have a bunch of strangers running around what was once their private garden. But this was deeper, a sense that something had shifted, and would never return.

You can take the caboose out of the ghetto, but you cannot take the ghetto out of the caboose. Many people at RailsConf felt your absence, comrades, if any of you are reading this! As I mentioned earlier, the vast majority of attendees, including repeat ones, were totally unaware of the specifics. But they sensed something missing, some crucial element lacking.

At the same time, the community is now larger. And there are tremendous advantages to the incursions of the money people into the private reserve. The people who were saying to each other in 2006, "I wish I could program in Rails full-time, and quit programming in Java/C#/WTFLang" were now saying "I wish recruiters would stop harassing me!"

That all said, the Rails community needs the caboose crew, like we need our gall bladders. It is just a little organ compared to the overall size of the body, but without it, you will not survive long, and if you do, you will be feeling so well.

It would appear that the rebels had struck their first blow. But more about that would be revealed on Day 3.

Chad Fowler still had the his job leading off the proceedings in the new, more corporate RailsConf. As such, the ukelele would be banished from the main stage, along with any other musical instruments during presentations. Joey, we miss your accordion, too.

Chad mentioned that there were over ten times more proposals for RailsConf 2008, than attendees at RailsConf 2006. That certainly explains why my proposal was not accepted... of course, the title being "Pedal To The Metal: Alternatives To Rails" might also have had something to do with it.

Anyhow, Chad was almost apologetic as he explained how people were pissed off about RailsConf 2006 because it had sold out so quickly, and now that they had increased the size enough, people complained that the conference was "losing it's luster." You can't win, dude! But I still support what you're doing.

At that point, he introduced Joel Spolsky. Now, when I had read that Joel would be the opening keynote for RailsConf 2008, I had been fairly surprised. Although the penchant of the Ruby/Ruby on Rails community IS to reach out to others for ideas and technology, with the well-publicized spat between Joel and DHH, the choice seemed a curious one.

Joel was funny, and entertaining. He had slides, and seemed like he was leading up to some big point. But after the dog and pony show was over, I felt like I had drunk an extra-large zero calorie soda: a feeling of fullness, but no actual nutritional value to it. I was not exactly disappointed, but I was far from impressed.

Next, I headed into the Entrepreneurs on Rails session by Dan Benjamin. The presentation was probably worthwhile if you have never formed a business before, but my attention wandered, which is why I will not be writing anything else about it here.

So far, I was zero for two on my personal "RailsConf 2008 was worth it" scale. Hmmm.

I got a bit more enthused at Micah Martin's session "10 Things I Hate About Web Development", where I finally got to see the long awaited demo of Limelight, which Micah had been dropping hints about at RubyConf last year. I have a separate posting I will put up with info on that session.

After that, with my energy picking up, I went to "Rubinius: Under The Hood and Behind the Curtain" presented by Evan Phoenix, Brian Ford, & Wilson Bilkovich. This was a fun and informative session about the current state of Rubinius, although if you have been following the various blogs/IRC/github you already knew what he was talking about. Still, it was nice to see the core Rubinius team in person, and to get the sense of the crowd's excitement about Rubinius. I will be posting separately about this session.

There was a great moment that is really representative of what I get out of RailsConf. Walking between sessions, I ran into Ward Cunningham. Not only did I get to introduce myself, and take another fanboy picture with one of the extremes, but we also stood around for a few moments and chatted about his experiences migrating MediaWiki to Rails.

Afterwards, I hung out doing a little pairing with programming buddy/collaborator Ari Lerner trying to help out with pool-party before his upcoming BoF about it later that night. I know you have not yet heard about pool-party, which is an auto-scaling solution for Amazon's EC2 service, since the first version was put up on github there at RailsConf. What makes pool-party unique is that it is a pure Ruby and open source solution to the cloud computing thing. Plus it is cool.

By the time we were done, we had already missed any chance of eating dinner, and also most of Charles Nutter's talk. I walking in to see a slide "You Are The Enterprise" from his presentation. That sounded silly to me, but without any context, I probably do not know what I am talking about here.

Next were the RailsEnvy guys presenting the "Ruby Heroes Awards". I have to say, those guys from RailsEnvy are pretty funny... and brilliant self-promoters. Plenty of people have already blogged about this, so no need to go on and on about it here, except to say they made some pretty good choices with the winners:
Evan Weaver, Tom Copeland, James Edward Gray II, Ilya Grigorik, Yehuda Katz, and Ryan Bates.

Good job, guys!

Then it was time for the big David Heinemeier Hansson keynote. After my tepid enthusiasm for the opening keynote in the morning, I hoped DHH would do something exciting. Well, that was not exactly what happened... but thought provoking, nonetheless.

His speech was entitled "The Great Surplus". The salient point seemed to be that the highly leveraged productivity that Ruby on Rails gives the community (and the unreal demand) will not last forever, or perhaps for even that much longer.

His prediction is that one of three things will happen:
1. The mainstream copies Rails with something else
2. Some other dramatic alternative arrives (new paradigm) that provides massive improvement
3. Rails itself becomes mainstream

So what to do about this? Invest in yourself. Regardless what happens with Ruby on Rails, if you better yourself it will last to next wave. And do something else beside programming! You need to train more than 1 muscle... same with non programming activities.. need to engage other parts of brain. And sleep more.

It is well known that tired people take longer to do work, and that the output is not as good as a result. More importantly, it takes a toll on that individual that leads to a longer term reduction of output. So why do we consistently see investors/executives pushing their technology teams this way. And why do we allow it, when we already know better?

I had seen a friend earlier in the day during the conference, who I had not seen since last year. His startup had become involved with a well-known incubator. But far from looking energized, my friend looked worn down. "I need a month with no electricity," he croaked. And this is where many, many people in the RoR community are actually hoping and praying to get to. This is what DHH was warning about.

After DHH finished his keynote, I ran over to the BoF for pool-party. The turnout was actually pretty good! Ari did a great job with his presentation, and at the end a guy from Amazon came up and chatted us up for quite a while. I look forward to switching over my AWS application to the pool-party as soon as it is ready!

My day complete, I crawled off to bed to take DHH's advice and rest up for RailsConf 2008 - Day 2.

Going Public: From Los Angeles To RailsConf 2008



With the high cost (and carbon!) of transportation, as well as the burden of the increased time it takes to fight your way through the congestion, we all need to change the way that we navigate thru our daily lives. I had decided to take public transportation to get from my house in Los Angeles, to RailsConf 2008 in Portland, OR.

When I first mentioned my plans, several friends and family members were incredulous. "It takes too long, " stated one person. "There's no way to get to airport in LA except by car, " scoffed another. I set out to prove them wrong, and by doing so began a new chapter in how I approach personal transportation.

I set out from my house in Silver Lake, walking down the hill to Sunset Blvd. I stopped at the delightful Cuban coffeehouse Cafe Tropical, which happened to be directly adjacent to the bus stop I would need to use.


I sipped a tasty cup and snacked on one of the delicious pastries while I awaited my first bus.



I jumped quickly (literally, they do not wait around) on the Route 704, which is a giant segmented affair. Despite that, the bus was almost completely filled until we reached the Evans Community Adult School (no relation), at which point almost the entire bus emptied out.

One notable feature of the ride were the video screens filled with advertising prominently situated on the bus, an attempt to subsidize the cost of the public transportation system here in L.A.




On reaching the Union Station stop, I exited the bus. I would need to walk to the FlyAway bus terminal to catch the non-stop shuttle to LAX. The way was clearly marked.

They wanted to make sure you could not make a wrong turn!

I purchased my ticket at a friendly kiosk.


The bus arrived shortly thereafter.

While I waited to board, I asked a half-dozen of my fellow travelers if they had taken the FlyAway shuttle before. All except one were first-timers, like myself.

We reached the airport quickly from the downtown Union Station. No having to drive, allowed me to check my email (GMail Mobile is still cool on my cheap phone) and daydream. Suddenly we had arrived at LAX. I noticed that my airline was in the very last terminal, and since the FlyAway shuttle would stop at each and every terminal first, I decided to get off there and cross the airport on foot.

It would seem there is plenty of parking, and available charging terminals, if you have a plug-in electric car.



I had made it to the airport in about 1 hour and 15 minutes, which was about the same amount of time that it would have taken me to drive my car to the airport parking, park, get on a shuttle bus to the airport from the parking location. Except my cost for transportation had been $5.25 instead of the fuel, plus the $60-80 for parking. With a small portion of my savings, I smugly purchased a copy of Predictably Irrational at an overpriced airport bookstore to read on the flight.

On exiting my plane in Portland, it turned out they were having a party to celebrate Portland having now become an international airport.



Politely refusing a multi-colored cupcake, I walked to the end of the terminal where the MAX, Portland's modern light rail system awaited.



I purchased a ticket from a automated kiosk, then hopped on the train. Around 15 minutes later, I had arrived at my destination.

I had successfully arrived in Portland for RailsConf 2008 only using public transportation! After checking into my hotel, I dashed across the street to the convention center. Alas, the registration had closed for the day exactly on time. Yes, these O'Reilly people are all business. More on that in my post on RailsConf 2008 - Day 1...

My luck would turn around quickly. I immediately ran into friends David Chelimsky and Micah Martin, who invited me to tag along for dinner. When you're hanging out with guys as smart as these, you absolutely cannot be bored, and you will learn a LOT! Plus, one thing about Chicagoans, we know how to pick a good place to eat. David led us on a brief journey to a great Thai place he knew of, and between the great food, beer, and conversation, we had a delightful time. Thanks guys, I appreciate it!