Rails VS. .Net MVC

Hello All,

I have been put in a tough situation at work. I have been developing rails applications for the past 2 years and thoroughly enjoy what I am doing. However it has been bestowed upon me to give an objective summary leading to the benefits of rails versus using Microsoft’s MVC capabilities.

I have been going back and forth with colleges on this and everyone has a response to how “their” technology is better. I am looking for some other ideas / reasons why you people in the community like rails as a way to gather more evidence of to why we should use rails in an “enterprise” (the buzz word everyone around here uses) environment.

Any opinions are greatly welcomed. I love rails and dont want to go down with out a fight but need some good ammo and am looking for the community for advice as a way to answer the question “Why is Rails better”?

Thanks,

-Chris

I may have to do such a comparison in the future. I was planning to watch the videos at http://www.asp.net/learn/mvc-videos/ and then play with ASP.NET MVC a little to get a feel for it. Based on the two videos that I’ve watched so far, I feel as though ASP.NET MVC is more complex than Rails and requires more effort to start a project. I can’t articulate more than that right now. Maybe you can take a similar approach. Also, I wonder if the guys at http://www.softiesonrails.com/ have any insights or opinions.

Regards, Craig

* The Rails stack has zero licensing fees (argument can go a long way in a tough economy)

I'd go to a .Net MVC group and tell them how great it all sounds and that your considering using it in your enterprise. Then tell them what you really want to know is what they >don't< like about it. That may give you some insight into what your coworkers don't like about it but aren't willing to admit out of fear it might hurt their argument.

Then if rails happens to not have those same issues you've got something to work with.

I took a quick look for a group myself and they seem pretty thin though... hmmm

Maybe that's a drawback in itself?

good luck!

You could throw all sorts of reasons at their feet and I still worry that for the most part it would be falling on deaf ears. There have been countless time I have heard people completely throw any non- Microsoft, IBM or HP solution out the door because of some pre- existing ideals they have. Its way less common today but still very prevalent.

Rails is a mature framework, ruby is a fantastic language but for the most part it still expects you to have a clue about what you're doing. It takes a few hats to be able to develop, test and host a rails app. In the .net world everything (mostly) is going to be hosted/done Microsoft's way... its hard to fight a fight like this if you are the only one fighting for rails, phb's want to be able to fire you and call Microsoft when they need help. To be honest I would assume that someone in a leadership position over a developer using rails would have seen value in it by now, which leads me to think that the boss has no clue and is easily swayed by any marketing documents. Rails is very opinionated and has choice some positions on things that not everyone else agrees with, and the beauty of that is people were passionate enough to go out and create their own frameworks instead of accepting what the core team decides.

Like I said, Rails is a mature well supported framework for developing web applications. Ruby if a great language and has only gotten better since a large group of developers started to use it when the moved to rails. Rails is open & ruby is open you have a choice when it comes to runtimes and hosting environments. If you get into metaprogramming and then try some of the fantastic things you're able to do in ruby with a language like c# you're going to be disappointed.

Ultimately I would say that it comes down to you, what do you want to do? If your happy with rails why stick around a shop that's not?

To sum it up: Rails... * $0 licensing cost to deploy, build and maintain rails apps, this can change of course if you decide to use certain OS's, databases, IDE's etc. But if you have a computer and an internet connection.. thats all you need. * Rails has a large community of active developers that you can rely on for support. * Rails will have better documentation for quite a while. * Rails/Ruby are mature. * Routing is easier and cleaner * Choice of free testing frameworks with great documentation is much broader.

Cheers, -Mark Turner

No, it's not.

How can you say something like that after everything that's changed from 2.2 -> 2.3 ? Or knowing what's likely to change with 3.0 when more of Merb gets merged in?

When I read things like "middleware layers being completely rewritten" it leads me to question why they were written so incorrectly to start with that they needed to be completely rewritten. When I read things like "memory sessions have been removed" I gotta wonder who thought they were a good idea to start with? Newsflash: some of use were using those. (Yes I'm aware of how to get them back using the plugin, that's not the point.) If you're gonna put something in there, have a good reason for putting it in there, have a reason so good that you won't later find an opposing reason strong enough to remove it.

The Rails API and docs change constantly and are often out of sync. Last month for example, api.rubyonrails.com was showing new 2.3 features before 2.3 was even released. How'd you like to be a new guy scratching his head over grouped_options_for_select being in the docs but not in the framework? I could much more easily accept the reverse case.

And what about the gem servers that are constantly up and down? How can newcomers have any faith in Rail's maturity when you can't even install it sometimes?

And what about the book situation? Rails is changing so much, so fast that a Rails book you buy today will be useless 6 months from now. I have 8 and 10 year old Perl books that I still use to this very day.

I love working in Rails, it's the fastest way I know of to build a website, but mature is the last thing I'd ever say about it. I have absolutely no faith in the API remaining the same from even a .1 to a .2 release, much less 2.x to 3.0. If you can't count on the user-level API being stable how can you even begin to say it's mature?

I certainly agree with a few of your points, but you can't compare a language with a framework. Ruby, the language, hasn't changed that much from 1.8.x to 1.9.x. So, the original Ruby book is still usable.

You could, though, compare Rails with a framework like Grails, which is much younger and more stable in the sense that it does not change as often as Rails. Probably, with Rails 3 we shall see some stability in the code, and some speed improvements: I was actually surprised to learn that Rails runs much faster with the JRuby interpreter when compared to the C version of the interpreter.

I really love Ruby and Rails, but I still think that they need to improve quite a bit. The interpreter may have improved already with version 1.9, but Rails will only be considered api stable after version 3.0, because right now, like you say, the books can't keep up with the framework itself. If you look at the number of Grails books out there, they are still usable, and if there are some changes, aren't that major. You can always find the solution on their website.

Those are my 2 cents.

Fidel.

Greg Donald a écrit, le 04/04/2009 12:03 AM :

  

Rails is a mature framework      No, it's not.

How can you say something like that after everything that's changed from 2.2 -> 2.3 ? Or knowing what's likely to change with 3.0 when more of Merb gets merged in?    Nobody forces anybody to upgrade. I've Rails 2.1, 2.2 and 2.3 applications running and only upgraded them when it made sense to do so (subjective estimate of long term cost of waiting for another release before upgrading > cost of upgrading now). Rails 2.1 is mature enough to me right now, I only used 2.2 and 2.3 because they'll probably be supported longer.

When I read things like "middleware layers being completely rewritten" it leads me to question why they were written so incorrectly to start with that they needed to be completely rewritten. When I read things like "memory sessions have been removed" I gotta wonder who thought they were a good idea to start with? Newsflash: some of use were using those. (Yes I'm aware of how to get them back using the plugin, that's not the point.) If you're gonna put something in there, have a good reason for putting it in there, have a reason so good that you won't later find an opposing reason strong enough to remove it.    Shit happens :slight_smile: Designing an application is hard enough, designing a framework to support a variety of applications is harder.

The Rails API and docs change constantly and are often out of sync. Last month for example, api.rubyonrails.com

Why use it ? For what I know this has always been the edge documentation. When I want documentation for my Rails versions I use http://localhost:8808.

was showing new 2.3 features before 2.3 was even released. How'd you like to be a new guy scratching his head over grouped_options_for_select being in the docs but not in the framework? I could much more easily accept the reverse case.

And what about the gem servers that are constantly up and down? How can newcomers have any faith in Rail's maturity when you can't even install it sometimes?    Nothing to do with the framework itself. Only a problem if you don't have access to packaged versions of these gems (I'm not familiar with these problems : Gentoo mirrors work well enough).

And what about the book situation? Rails is changing so much, so fast that a Rails book you buy today will be useless 6 months from now.

Only if you don't install the Rails version the book was written for (why would you install another as a beginner ?). Anyway I'm not the best person to answer that: I learn from blog posts, documentation and source code, not books anymore.

  I have 8 and 10 year old Perl books that I still use to this very day.    Hum, I'm not doing a MVC web app in Perl even with Catalyst. Note that you are comparing apple with oranges, the Pickaxe is very usable right now. These books will be thrown away when people want to learn Perl6, doest it make Perl5 immature? I'd say Perl5 is not the brightest language around, but it *is* mature.

I love working in Rails, it's the fastest way I know of to build a website, but mature is the last thing I'd ever say about it. I have absolutely no faith in the API remaining the same from even a .1 to a .2 release, much less 2.x to 3.0.

I agree, but: - why upgrade if you don't need to ? - if you need to, it's not that hard to upgrade once you are coding Rails apps for your living (why would you upgrade if you don't ?): deprecated methods should be right in front of your eyes when you run your tests/specs.

Lionel

To me it's mostly about the Open Source culture: Not only Rails, but the entire stack as many have pointed out. Open source is not only about free (as in beer), but the freedom to do whatever the heck you want with it - for instance, deploy on nginx with mongrel, or thin, or passenger, under any number of VMs and OSes, as well as databases. This is the kind of freedom you get on an open source environment, much unlike Microsoft. By using .Net MVC, not only are you locking your "VM" to the .Net framework (not sure if Mono is a viable option), but also you would have to deploy on the windows stack, and get ready to pay for licensing fees for both Windows Server and SQL Server. It does add up, especially if/when you scale horizontally. Be sure to bring this up when they make the point the MS .Net MVC was recently open sourced.

The Rails community has lead the path in web development industry with practices like TDD and BDD, DRY, YAGNI, convention over configuration, full integration with javascript frameworks enabling the use of Ajax, etc. These are certainly possible and encouraged by other frameworks, but Rails lead that path and made it real and tangible.

Finally, Ruby is just a joy to work with. I firmly believe that it helps developers write shippable code faster, and with less bugs. Blocks and procs make life more enjoyable. Not having to write BS code to simply call something on each element of an array, by example, just talks for itself:

Here's a brief example: for (int i = 0; i < my_array.length; i++) {   my_array[i].something() }

Or: my_array.map(&:something)

Same goes with the dynamic nature of the language and how it makes meta-programming accessible...

The bottom line is that by using Ruby (and Rails), you will most likely be able to develop new features quicker, you and your team will be happier, and you'll have a broader set of deployment options for your apps. What's most important for the business is getting features out the door, with as few bugs as possible, and being able to maintain them throughout the life cycle of the product. In this sense, Rails delivers.

Good luck, -H

> Rails is a mature framework

No, it's not.

This conversation will go way out of Chris's question's. Sorry Chris.

How can you say something like that after everything that's changed from 2.2 -> 2.3 ? Or knowing what's likely to change with 3.0 when more of Merb gets merged in?

When I read things like "middleware layers being completely rewritten" it leads me to question why they were written so incorrectly to start with that they needed to be completely rewritten. When I read things like "memory sessions have been removed" I gotta wonder who thought they were a good idea to start with? Newsflash: some of use were using those. (Yes I'm aware of how to get them back using the plugin, that's not the point.) If you're gonna put something in there, have a good reason for putting it in there, have a reason so good that you won't later find an opposing reason strong enough to remove it.

You're trying to tell me that backwards compatibly is the key to determining maturity? I disagree completely. Just like moving from gcc 3.2 to 3.4.. regressions happen. Hence the reason for the developer to stay on top of the changes in the frameworks, tools and languages they use for a living. Hell look at Java 1.4 to the current 6.x (which if you follow their previous versioning it would be 1.6)changes most of the user exposed API's have been left alone but there are plenty of examples of changes that would cause you to experience pain deploying your 1.4 app on any 6.0 jre.

This is one of the reasons testing has become so popular, not just in our community but in most other development communities.

And I calling rails mature in comparison to .net mvc seems pretty rock solid to me.

The Rails API and docs change constantly and are often out of sync. Last month for example, api.rubyonrails.com was showing new 2.3 features before 2.3 was even released. How'd you like to be a new guy scratching his head over grouped_options_for_select being in the docs but not in the framework? I could much more easily accept the reverse case.

Agreed.

And what about the gem servers that are constantly up and down? How can newcomers have any faith in Rail's maturity when you can't even install it sometimes?

Rubyforge happens to be the standard gem repo right now, and installing rails through gem is the de-facto standard method but hardly the only way.

And what about the book situation? Rails is changing so much, so fast that a Rails book you buy today will be useless 6 months from now. I have 8 and 10 year old Perl books that I still use to this very day.

Hmm and I seem to have an 8 year old ruby book that is still just as valid as it is now, this is about Rails not Ruby. Try opening the Catalyst book from packt and tell me things won't be different today. This is an issue with computer books that's been around forever.

I love working in Rails, it's the fastest way I know of to build a website, but mature is the last thing I'd ever say about it. I have absolutely no faith in the API remaining the same from even a .1 to a .2 release, much less 2.x to 3.0. If you can't count on the user-level API being stable how can you even begin to say it's mature?

I guess we have different views about maturity. Oh well.

Perhaps this article [ http://www.infoq.com/news/2009/04/fubu-mvc ] on FubuMVC, “an alternative MVC implementation in ASP.NET,” might be of interest, since it includes some reasons that the creators of FubuMVC prefer it to Microsoft’s MVC implementation for ASP.NET.

Regards, Craig

And what about the book situation? Rails is changing so much, so fast that a Rails book you buy today will be useless 6 months from now. I have 8 and 10 year old Perl books that I still use to this very day.

Wow yours last 6 months! I ordered the latest AWD with Rails book sometime around last October and it was supposed shipped in December. Just got it last week and it's already out of date because it doesn't cover all the great new features in 2.3 not to mention what's coming in 3.0 here very shortly. Not that it's still not useful but UGH!

I guess the case I'd make for it is that your company should have been using MVC all along. While Rails is an MVC framework, there are multiple benefits to using Rails besides three letters. Substruct, Castle, and others have been available but none of your managers have been that interested in pushing it. This sounds, sadly, like an excuse to stay with the Microsoft developers because there are a lot of those around.

The problem with that is that if those developers aren't thinking about MVC already, they're not gonna benefit much from this now UNLESS MS pushes future development in ASP.Net to the MVC pattern.

Ruby, and Rails, give you these features either completely or much easier.

* Full stack open source. You are not reliant on a vendor to release a patch. If a security concern arises, everything from the views to the server itself can be patched. Easily.

* Testing. It's easy to talk about writing tests, and I know for a fact that most places that write code for other people just don't do it in the .Net world. I cannot live that way and I vbet you can't either. N:Unit exists, but have you tried using it? In the Rails world, writing simple or complex tests are so easy to write you're foolish if you don't.

* Experience: .Net has been around forever, but the MVC framework is new and if past products have been any indication (.net v1 and v2, silverlight 1 and 2, etc) are any indication, it's just *good enough* and surely not *good*. While you probably have a lot of .net developers, you probably don't have a lot who *know* the .Net MVC framework. With Rails, it's easy to find someone with 3 or 4 years of experience with the whole stack, including testing.

Of course, this is exactly what you'd expect me to say, right CJ?

Perhaps you need to really take on what they're saying. It's not a
fight as I see it, unless you make it one.

And... Why fight?

I used to train in a martial art, and people would often train with me
with the attitude that they're 'way' of doing something was better.
The only whole way to address their issues is to embrace them and try
out their way! Try it on honestly and that will show you why you use
your way, and maybe even learn their point of view!! :slight_smile:

Example: I prefer mac os/x and apple gear. I regularly use pc's at
work and once years ago when I was a graphic designer, I even switched
to pc for a few years at the advice of someone. It was good advice,
and he was right to suggest it on the surface, but I got so sick of
all the little things missing that I bought a mac again. I really knew
pc's quite well - I could do EVERYTHING via keyboard shortcuts. But I
still preferred the mac because of several key reasons. They were
quality of attention to detail of finish on everything, what they left
OUT of their interfaces, and the Porsche feeling - the things they
make are often just so beautiful, they make me happy :slight_smile:

My point is, though, without going through the experience of trying
other suggestions, you can't really know if your choice is a valid and
informed one, if that's important to you. If you do go through the
experience, I guarantee you'll learn a lot and also that your
appreciation of whichever tool you choose will increase magnitudes.

Be careful, though, of fostering us vs them attitudes. This won't make
you happy. The creator of ruby's goal was to make programming
enjoyable :slight_smile: don't forget that not everyone loves sunshine, though,
and do you know what? That's valid!!!

Love, Julian

Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/

Oh, I just have to also add that you must be fully prepared to 'lose'
to address this in a way that you will learn from. That is, if this is
what you want.

:slight_smile:

Have fun!

Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/

I certainly agree with a few of your points, but you can't compare a language with a framework.

Alright then. Let me rephrase it. I've got .net book that are 4 and 6 years old that I still reference to this day. I've got a Java Swing book that's ancient that's still very relevant today. Apples to apples and oranges to oranges, there you go.

Ruby, the language, hasn't changed that much from 1.8.x to 1.9.x.

Bullshit. It's changed immensely. Ruby 1.9 has fibers now, there are native threads, there is unicode in fast C, no longer in Ruby. There are actually so many new features in 1.9 people are pissed that it's not named 2.0. I've been playing with all sorts of new 1.9 features the past few weeks. Sadly one of them is not a working MySQL gem, but it'll catch up at some point I'm sure.

Do you follow Linux Kernel development at all? It's a cardinal sin to even attempt to change a userland API. Behind the API things evolve immensely, but the API itself, that we as developers build software against, never, ever changes. But then on the rare occasion that it does change, you can bet your ass the version number will move by a lot more than .1.

When the Rails API begins to remain unchanged for even a few releases in a row, maybe then you can start calling it things like "mature".

Yeah look at Photoshop - their Interface changes all the time. That's
part of it. I like merb's method of keeping versioned documentation.
That's nice.

Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/

Lol isn't that a good thing? Once you learn rails 2.1, 2.3 is not that
much of a jump! :slight_smile:

Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/

I love PHP's way of telling me when a function first appeared in the API, for example:

http://us.php.net/manual/en/function.strstr.php

And then further down the page there is the individual changelog for the life of this particular function in the API.

These aren't muually exclusive. Perhaps we could use both

Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/