At the heart of this comparison are different philosophies particularly around “Constraints are liberating”. This quote came to my attention from David Heinemeier Hansson presentation in 2005 which is here and the first part which is equally important is “Flexibility is overrated”. Personally I really like this approach and it is what makes Ruby on Rails great to use. However ASP.NET MVC has gone in rather an opposite direction.
Using ASP.NET MVC you start off by having to decide which Model “provider” you are going to use. Yes, it is flexible but it you just want to get started this can be a bit over-whelming. As noted in the excellent NerdDinner tutorial for MVC you can choose from LINQ to Entities, LINQ to SQL, NHibernate, LLBLGen Pro, SubSonic, WilsonORM, or just raw ADO.NET DataReaders or DataSets. Wow, maybe “flexibility is overrated”.
Yes “Literally every part of MVC Is pluggable” which can be a good or bad thing depending on your perspective. However ASP.NET MVC is at version 1.0 and I am certain it will evolve quickly and hopefully provide default ways handling common scenarios such as validation.
So rather than goes through long list of feature comparisons I have come up with my top three points for both ASP.NET MVC and Rails. Off course this comes down to what you place value on but I am sure there is some commonality for those who have tried both :-
Ruby on Rails Top 3 Features
1. Consistency of approach tied to convention over configuration
This is quite hard to explain unless you have tried it. Also it is a bit hard not to sound too “fan boy” about it but from the very first demo of Rails I saw it left a lasting positive impression.
Everything is included and it is very much a case of “don’t make me think”. With one command you can get the Rails engine to create the database using Migrations and scaffold up you entire app (Views, Models and Controllers). Yes, yes I know you need to modify it from there but it is really well formed start.
Particularly with Rails 2 and the inclusion of REST scaffolding it got a lot better compared with Rails 1.x.
2. Heroku provides an amazing scalable instant deployment platform
Maybe there is something similar for ASP.NET but I haven’t found it yet. Heroku provides a vast range of options and I have only used their free Heroku Garden option. However it works very very well and it just so easy to deploy your Rails app.
In a more general sense deployment of Rails into a Linux / MySQL platofrm is simply more cost effective. I have not tried Phusion Passenger however I keep hearing good things about how easy it makes Rails deployment which is a big turn around from 18 months ago.
Maybe cost is not the only factor and there are some other advantages with Windows hosting. Certainly Microsoft SQL Server is a good database however in many instances is more than is needed for a Website.
3. Lots of helpful people and great plug-ins available
I didn’t want to use the word community but what it boils down to a ton of excellent resources everywhere from books to blogs to video casts.
I have found people are happy to share their knowledge and make code / plug-ins readily available to cover all sorts of very relevant functions available.
If you want to integrate your site with other Social Networking Sites or big providers like YouTube then I think you will find something much quicker than with ASP.NET MVC.
ASP.NET MVC Top 3 Features
1. Great tooling support
Visual Studio now at version 2008 really grows on you as a powerful environment to code in. I have used it on and off since 2000 starting with J# and it just seems to keep getting better.
The code completion (intellisense) fits strongly with VB.NET and C# more naturally than it does with Ruby being dynamically typed.
Oliver Steele recently wrote on language mavens and tool mavens which I found interesting. So I guess that puts me in the tool maven category with this feature.
Good integration with SQL Server and strong tooling around the database in the form of Management Studio make it quite a compelling experience.
Not to mention 3rd party and build in utilities for code analysis, refactoring.
2. Development performance
I emphasis the development side of it as once you are in Production it is quite a different scenario.
The bottom line is that Ruby runs comparatively slowly on a Windows PC and waiting for Rails to start it is a bit of a drag. Admittedly I it was hard to tell if it was the Ruby WebServer eg Mongrel that may have been slow starting but in comparison ASP.NET is instance.
Arguably if I was serious about Rails development I would have brought a MAC or at least using Linux.
Admittedly in the scheme of things this is a minor annoyance and I certainly appreciate all of the effort that has gone into porting Ruby MRI on to Windows has outline in this interview with Luis Lavena
3. I get to do more of it and it is more productive that WebForms
Since 2003 I have done various WebForms projects with varying degrees of success. The smaller ones were quite successful but the larger ones got quite bogged down. My GridViews in particular was a bit of a love hate relationship trying to get them to work as I wanted.
In comparison to WebForms ASP.NET MVC has been a breath of fresh air. Nice clean HTML with no ViewState and “real” HTML form elements without layers of abstractions eg “TextBoxes” that became “TextAreas” etc.
Client side validation controls in WebForms was an area from day one I found clunky and shifting that into code within the ASP.NET MVC Models is much “nicer”.
Having completed my first ASP.NET MVC project I am pleased with the results and the ease with which I can change it. The initial development always being the smallest part of the work with ongoing enhancements being what is really critical.
Ruby vs C#
This is an area that I am neutral about. I have realised that I have simply not invested the time to learn the power of Ruby and get the most from it.
It was only when I read Chapter 2 of the book Rails for .NET Developers. This chapter which is available for free here is called Switching to Ruby. I realised that you can code Ruby like C# or probably any other language but you simply won’t get the benefits. I know in hindsight this very obvious but there are some many subtleties to Ruby it is easy to miss them until it is explained clearly.
For me as a VB.NET programmer I know .NET and spent a couple of years on JAVA so C# feels comfortable. The .NET framework is very comprehensive and well documented. Not to say there is not good documentation on Ruby but probably not to the same consistent level across all the libraries.
In the end…
I know I am sitting on the fence. I have learned a lot from Ruby on Rails that I can apply to ASP.NET MVC so for that I am very grateful. Maybe I can have my cake and eat it too as a Microsoft Developer.
I know this sounds a bit cliché but “if you do something you love you will never have to work a day in your life”. Bring it back down to reality I am looking for something that keeps up my interest in software development and does not frustrate me at each turn. For the moment ASP.NET MVC has restored my enthusiasm for Web Development.
So for the moment my main focus in the Web Development area is on ASP.NET MVC but I will always keep across the developments in Ruby and Rails. For me it is a matter of balancing what I know and am productive with to learning new things that are potentially more productive.
For someone else’s view I thought this post by Kevin Pang was a good summary
Posted by Norman
Posted by Norman
Posted by Norman 




