Foy Savas

Let's Be Clear: The Rails Monoculture Is Over

Normally, I'm on top of all things Merb, sometimes even to the point of stalker-like observance, but last week I decided to go offline. Determined to finish up about half-a-dozen of The Merb Way chapters before Christmas, I chose to isolate myself completely. No phone, no email, no IRC. Just me, the Merb source, and my manuscript. It couldn't get any better, and besides the week was slated to be a quiet one, so there was no way I would miss a thing.

Then Dec 23rd rolls around. Sophia and I are packing up to visit family in Maine, and naturally, I turn on my phone readying it for the trip. That's when I get the call. It's Obie.

"Foy, have you heard the news?"

"Oh yeah. The book distribution plans, right?"

"No... It's not that - Rails and Merb are merging."

Not yet sure if I was part of some elaborate prank or not, I jumped online mid-call. Sure enough, everyone was buzzing about it. Merb would be the new Rails, and not in the metaphorical sense we might have tossed around before. This was it, a real merge.

Needless to say, I cursed my hiatus and got on IM and IRC looking for answers.

"Where were you?", I got asked. "I freaked out for you for like almost a full week, I was really scared you would flip."

Slowly, I digested the full story hearing it directly and individually from Ezra, Yehuda, and Matt. It seemed that tensions between the two development teams had risen to an all time high after the Antonio comment wars. Somehow, though, that very tiff had also induced a fair amount of dialogue. Eventually, the teams got to earnestly talking about the fundamental differences between the two frameworks, and though they didn't find many, they were able to draw the following conclusions.

  • Merb had numerous fundamental enhancements including stack agnosticism via modularity and better performance through tighter implementation.

  • Rails was still the more mature of the frameworks sporting a boatload of both proven and widely used features.

Now apparently, it took both teams some time to ruminate on these conclusions, but when they did, they realized that they both wanted what the other had. And that's when they started to ask, why not work together?

Now everyone knows the rest of the story, so I won't continue. However, what I will say is that when the news hit the general public, not everyone was happy. This included myself, who aside from having had his world turned upside-down, was still fairly skeptical. Yes, there were more practical concerns I should have been thinking about at the time, like the fate of The Merb Way and all my Merb apps, but it was the potential loss of Merb's awesomeness that kept on surfacing in my mind. I couldn't go without it and needed to know that it wasn't gone.

Thankfully around this same time, I began to talk to Yehuda about the details of the merge and how it would be approached. Despite my initial worries, things were positive. In fact, by the time I heard about us developing an API test suite and the necessary incremental changes to produce a rails-core, I got to wondering: is the Rails monoculture over?

What an odd thought, you might think. Here Rails is merging in Merb, but yet somehow reverting to only one major Ruby web framework is going to end the monoculture? If that confuses you, I'll admit, it messed with my mind too at first, so let me explain.

First off, though a lot of people have thrown the phrase Rails monoculture around, I haven't seen anyone define it. Let's do so before we proceed.

Rails Monoculture: the implicit shunning and later difficulty of deviation from the Rails stack.

Now, how could this have happened anyway? Well, to be sure, some of this was based in, as Matz said, the fact that Rails changes fundamental idioms of Ruby, but the more significant reason was that the Rails opinions were going unchecked. That is, everytime you wanted to deviate from the stack, you ended up piling on added difficulty. This difficulty made it hard to convince the rest of your team and sometimes even yourself to go with it.

Anyway, I'm not blaming the Rails development team for what happened. To me it only seems natural, especially given the near continuous positive feedback they had received for Rails in nearly every other way. Opinions weren't just getting them noticed, in most cases they were working, so why stop?

However, with time, not all of us could concur. After all, we weren't all making the same web app, so deviation is to be expected. Enter Merb, a framework that though born simply to be a lightweight speed-daemon, grew up to be shaped more by a culture of open-endedness than anything else. Honestly, we had all been bunch of malcontents who had itched for our own deviations from the Rails opinions. Thankfully though, this didn't mean we shared the same opinions, and so instead of forging our own inflexible stack, we decided to build an agnostic one through modularity. Now this isn't to say that we didn't love Convention over Configuration, but instead, that we had all come to feel the pain of what might have been called Convention, No Configuration. We wanted instead a potentially opt-in system, and so that's what Merb became.

Soon, as Merb hit 1.0, others began to notice, and our reassessment of the appropriate limitation of opinionated software came to surface. For the first time, the benefit of making the gems as stack-independent as possible became apparent. No longer did you want to write a Rails or Merb plugin. Instead the goal was to encapsulate basic functionality that could be used by whatever application needed it with as little extra required as possible. The point is that this wasn't so much because there were now two major competing frameworks, but instead because it was becoming a recognized best practice. Credit where credit it is due, it was Rack that seemingly first set us on this path, and then Merb that popularized it.

I know that there has been much skepticism out there, so let's be clear: if the Rails-Merb merge meant a continuation of monoculture, it would be nothing but a lose-lose situation. However, that's not what's happenning. Merb's spirit is not being assimiliated, it is being included. By the time Rails 3.0 comes out, the Rails stack should fully allow for opt-in modularity. Don't let the concept of the merge confuse you: monoculture is over, and this is a genuine win-win for everyone.

I'm going to now address some of the other concerns I've been approached with since the news of the merge.

The most common of these is among Merb developers worried about the future of their apps. Here's your answer: don't be. I and many of the other Merb contributors have numerous Merb apps out in production. There's no way we can leave them out in the cold. Expect a smooth transition to Rails 3.0, no matter whether you're currently using Merb or Rails.

The second most common concern is that the merge is going to come at the cost of some of Merb's goodness, and to that I have to say this: absolutely not. Yes, it'll take time to get it all working just right, but the Rails team is deeply sincere about the merge. This weekend, I'm personally hoping to start helping out with Rails router modification on the 3.0 branch. It's going to be great, so please, stay calm.

Finally, nearly everyone I know has been asking me about what will happen to The Merb Way, and to be honest, I'm still not sure. However, my hope at this point is to at least get out a PDF even if the book does not get to print. Beyond that, all I can say is that Obie and I are now thinking of collaborating on the next edition of The Rails Way. While I never thought I'd start off writing a book on Merb, only to end up co-authoring one on Rails, I sincerely believe this to be an amazing turn of events.

Deep down this is because I've loved Rails for quite a long time now. If you got the chance to hear my talk at ProRubyConf, you may remember that I once quit one considerably well paying job because the management foolishly decided to move from Rails. Yes, that's how strong my attachment to the framework has been, and even though it's obviously been a rocky road since then, getting the chance to come back to Rails again, now without any regrets, is certainly a beautiful thing.

blog comments powered by Disqus