12 Reasons I Use Rails instead of .NET 22
I recently got an email from someone asking for a quick list of features that, in my opinion, make Rails great. I thought I'd copy and paste my answer here.
I actually get this question quite a bit, so you'd think by now I'd have a brilliant, prepared answer... but I don't. :-)
So here's my lame answer that I'm rattling off the top of my head - of course these are just my opinions, and I'm not implying that other frameworks don't have similar great features; but these are simply the top features of Rails that come to mind.
- Ruby. The language is just awesome for object-oriented development. Remember, I was a longtime C++ developer, and C# after that, so I've always loved statically-typed OO languages. But I usually get more done with Ruby in less time.
- ActiveRecord. The easiest ORM I've ever used (again, it's mainly because of Ruby's language features that make this possible)
- Forced MVC design. There are other great architectures for the web, but for database-backed apps, MVC is fine 80% of the time; so for that sweetspot, Rails makes it easy.
- TDD support. To call it "support" is to understate it. Rails expects TDD, and so it's a first-class citizen in the application skeleton. The best Rails developers I know all use TDD. It's the only framework I know that doesn't just "allow" you to do TDD, it assumes you ARE doing TDD, and makes it easy to do so.
- Ajax support out of the box. And in a clean way that again leverages Ruby to its fullest. There's almost no mental context switch between writing Ajax and non-Ajax code - it's all Ruby, same idioms, same "feel" of where your code should go.
- Agile development baked in. Like TDD, everything about a Rails app skeleton screams for best practices, and it goes out of its way to induce you to keep your code DRY, refactor often (this is why the TDD aspect is so important), and build incrementally.
- Limited choices coerce you into following Rails' best practices. Some people call it the "opinionated" side of Rails. I call it standing on the shoulders of giants who've already figured out good ways to stitch together the various tiers of a web app. The REST support in Rails is a great example of how average developers become good developers if they follow Rails opinion on how you should think about your application.
- Database agnosticism. There's built-in support for, I don't know, about eight popular databases, and it's almost 100% transparent.
- OS agnosticism. I develop Rails sites on Windows as easily as I do an a Mac or Linux (ok, I sort of take that back; the tool support isn't quite there on Windows, and the refusal of Microsoft to include a gnu-compatible C compliler with Windows keeps guys like me behind the rest of the pack).
- It's fun. Sounds weird, I know. But it's not just me saying that. The ease with which I can start building an app and see results, with tests from the start, make it more fun to work on Rails apps.
- It's all free.
- The Rails core is kept to a minimum. There's more power with a lot less API "surface area" than any other framework I know. Most Rails developers don't need intellisense, because it's much easier to just know what to do; and when you're not sure, everything is so consistent between classes, it's much easier to just guess the right thing to do.
- Plugins from the community. Awesome.
Agree with any of these in particular? Have a question about any of them? Think I'm off my rocker? Drop me a comment and let me know.



Hey Jeff,
Great list! I'm still not crazy about the inevitable spaghetti code and doing scriptlets (code-behind has really grown on my after all these years), but I'll otherwise wholeheartedly agree.
A couple of other observations that would work against the rah-rah Rails camp:
The first two are argumentative and subject to statistical proof...the latter is pretty much a given. I'm not sure if you can make application activation any easier than XCOPY.
Thoughts?
My favorite is "Forced MVC design". Every DataSource other than ObjectDataSource, i.e SqlDataSource, can raise a question "Is this PHP or is this a .NET?".
Not to mention, "awesome" codebehind. It's cool, I must admit. But everyone can easily abuse it (like, storing SQL logic on every codebehind and justified them as "separating concern" for instance).
On TDD, I'm not strongly agree with you. Even UnitTest is first class citizen on Rails, any developer can easily ignore rake:test. The same thing happens on .NET world, I believe.
My last pain in .NET is "compile everything". Why would I need to compile a web page to see the result? If is some kind of assembly then I surely understand, but this is a web page. I know it's by design (M$ people will happily call this as 'feature'), but then again it's only a web page. Man, I've been in .NET development for over three years and I still can't bought that.
Great list, Jeff! I would add three to the list:
I'd have to add: Migrations.
What I like about a lot of your reasons is they remind me a lot of my first days developing Windows applications with Delphi. Delphi is the Rails to the C++ ATL/MFC apps, sitting at that sweet spot of easy of use, discoverable methods and just shear joy to program in. It's community is super passionate and helpful while also creating a huge number of components. It didn't need anything besides the single EXE it compiled, unlike a lot of other Win32 development platforms. It has the ease of VB yet the full power of C++, in short it managed to give you all the power, simply.
These days I have my thumbs in quite a few pies, so I develop in C#, Ruby, Delphi and PHP, not to mention JavaScript, XHTML and CSS, and I've still not found the one language and framework that works for everything. There are things in Rails that I beat my head against that would be dead simple in .NET, yet of course there are times when I just want the simplicity of ActiveRecord in a quick PHP app.
I agree with everything said to this point, in particular I agree with Wynn that the Rails "show don't tell' community is what makes RoR welcoming, fun, and truely open.
ROR is great for web apps, .NET & C# is great for local apps
I forgot to add C++ is better for low-level stuff, i.e DirectX and games
@Jason: I think spaghetti can be cooked in any framework. But you're totally right, Rails has some catching up to do in the ease-of-deployment department. But I'd rather spend a half day troubleshooting a Rails app deploy, and save three months of development time with Ruby, than the other way around.
@Rick: Right on. No idea why that didn't come to mind when I was writing that email, I guess I just take it for granted nowadays! Thanks for that.
@Shawn: Ah, yes, Delphi was sweet.
@NC: I figured everyone assumed I'm comparing Rails to ASP.NET, not .NET in general... of course for client apps on Windows, .NET rocks, no doubt about it, and I still enjoy writing rich client apps in C#.
Great list!
As a (mostly) converted Softie myself, I have to agree with everything Jeff says.
Rails has been a breath of fresh air. As I write Rails code I find myself frequently commenting to my partner, "Man, do you remember how long this took us with .Net?".
Granted. I'm no .Net Ace, I just used VS.Net to put out a few good ecommerce and CMS projects over the last few years. The exact kind of thing that Rails really excels at!
We're just about to wrap up "v1" of a new ecommerce app and it's cleaner, less code (written by us, there's still the framework code for you sticklers), more robustness (thanks to those tests Jeff mentioned), and is easier to maintain and update. Oh, and it's taken FAR LESS time than my .Net projects with less features did. Even without Capistrano, it's just a 1 - 2 command deploy (2 commands if i have db changes).
I still create sites on my .Net CMS but anytime I have to actually change .Net code I cringe because of all of the extra code I have to write when compared to Rails.
All in all Rails makes me more productive and has brought the fun back into web development for me.
ะก# the best! from a .NET FAN!!
Migrations are OK, until you start using them heavily. They also don't work well with version control. Revert to a previous version anyone? I suppose you could not store them in SVN, but how do you work with your team then?
Rails template system should be more like DJango's, and restrict any ruby code from being embedded within them. It isn't so nice to have logic in your template and your controller.
AR is nice, but for .NET I would say LLBLGen beats it hands down. Plus you get intellisense when working with it. DJango's ORM is nice too, you can design your models in simple Python classes, and sync it up with your DB. Again, you get intellisense here too (using PyDev with Eclipse).
All in all, rails is nice for our website, it is pretty easy to maintain for the most part. Our core applications are still written in .NET, and probably will never be converted. There are just too many nice .NET tools and controls out there to get the job done. A treeview control that you can just drag to an Atlas update panel comes to mind.
Great list, but can I press you on 'OS agnosticism'?
I love Ruby, and I love Rails, but deployment issues could be a real showstopper when it comes to adopting it at my company. I was wondering if you had managed to successfully deploy Rails apps onto Windows servers (be it using Apache or IIS), or do you always target *'nux for deployment? How does the performance compare between Windows and *'nix? Is Windows a serious option for deploying Rails apps?
Stu
@Stu: Great question. The deployment story for Windows is slowly but surely getting better. I might recommend Rails on Windows, written by the two foremost experts in the area, Curt Hibbs and Brian Hogan.
Basically, I'm not sure IIS is ready for prime-time Rails yet; Apache w/Mongrel is currently the best way to go. However, I know that Microsoft is working on an FCGI implementation for IIS7, so an IIS7/FCGI environment might also be feasible in the near future.
This is also something we'll also be touching on during the Essential Rails class in September.
"OS agnosticism. I develop Rails sites on Windows as easily as I do an a Mac or Linux (ok, I sort of take that back; the tool support isn't quite there on Windows, and the refusal of Microsoft to include a gnu-compatible C compliler with Windows keeps guys like me behind the rest of the pack)."
Ruby is not any more OS independent as .NET. C# is also available on Linux and OS X. And there was a time that I was forced to stick to Windows, and as BackgrounDRb was not Windows compatible, I had to ignore RoR. I believe if OS independence is a very important requirement for a project, RoR is not the best choice.
Behrang: Sorry, couldn't disagree with you more on this one. Of course Ruby is more OS independent than .NET. C# available on Linux and OS X? If you're talking about Mono, I won't even start the debate of how usable/universal Mono is. Meanwhile lots of folks develop Rails apps on Windows and deploy to Linux servers - just look at the success of Eclipse, RIDE-Me, and Aptana for Windows IDEs. Not to mention the download rate of the Ruby One-Click Installer, etc. Meanwhile, I know of no one writing C# WinForms or ASP.NET apps on a Mac. But I do agree completely that Windows tools are still lacking and deployment to Linux is still the most popular choice.
Stu Holden,
As far as deploying web apps on windows servers. Yes, I've done it at my company using both Mongrel and standard webrick. I dont know how you could do it with IIS, and my attempts at making it work with Apache all failed.
Let me know if you have any questions, but it's incredibly simple with both Mongrel and Webrick.
"(ok, I sort of take that back; the tool support isn't quite there on Windows "
I use the Steel [Personal Edition is Free] RoR Pluging for Visual Studio, from SaphireSteel. Its a great environment for those of us who are used to VS, and transiting from C# development. See http://www.sapphiresteel.com/Ruby-On-Rails-Development-In-Steel
(Noetic acts are only modalities of, by reconciling with cognition, multiplicities of phenomenology) The fact is evident that an object, even with respect to the evidence in which multiplicities of the task of clarifying cogitationes present themselves, denotes a universal primal phenomenon of what is itself given.
Separated modes of consciousness, naturally, become modalized also in correlation with multiplicities of cognition.
Nice Site! http://google.com