Rails, say hello to .NET.
IronRuby went 1.0 at April 12th, and it runs Ruby on Rails for real. I demonstrated it myself to a packed room of (mostly) .NET developers at Community Day. There was a lot of buzz around IronRuby more than two years ago – back then, the hype around Ruby on Rails was at its peak and the .NET developers wanted in. It took a lot longer for IronRuby to go gold than many of us had hoped, and meanwhile ASP.NET MVC made its entry. Many ASP.NET developers were aware that the “webform” abstraction with its events, viewstate etc. is leaky and broken, and when Microsoft finally presented this “official” alternative to webforms they rallied to it and rejoiced, for now they had their own Rails-clone, but with a proper programming language and thorough IDE-support.
My presentation compared ASP.NET MVC to Ruby on Rails. The conclusion is ambiguous. I thought I’d be able to crush ASP.NET MVC with the pure greatness of Ruby and Rails, making it obvious to everyone which was the better framework and language. While Rails do support a lot things that ASP.NET MVC is nowhere near of having, the latter does – at least with the recently released version 2 – have the central elements of a proper MVC framework in place. What’s more surprising is that C# 4.0 is so much less clunky than C# 1.0, so in some comparisons of syntax Ruby is not even the obvious winner when it comes to readability. Take this example:
Before LINQ, C# would have never been able to map a collection in a such an elegant manner. In my biased opinion, I still find the Ruby version prettier and more readable, but the fact is that C# is not that far behind. It’s another syntax paradigm for sure, but it’s compact and it’s readable – that’s not bad at all.