views:

1534

answers:

9

I need to learn and adpot the MVC methodology for building web apps. Which is the better way to go given that I have experience with ASP .NET Webforms - ASP .NET MVC or Ruby on Rails?

I've heard people going gaga over RoR and its simplicity and its features such as scaffolding, ActiveRecord, convention over configuration etc.

However, I fail to see what is so great about these. Most of them sound basic (the kind you'll not really want to use in production code - scaffolding for example) - and most of them sound like they are there in ASP .NET MVC in some form or the other.

Why should I consider learning RoR over ASP .NET MVC?

Are there benefits I do not know about or am unable to perceive?

+1  A: 

Considering Stack Overflow is written with ASP.NET MVC I think it might be sacrilege to promote RoR over MVC.

MVC has pretty much given Microsoft lovers one more tool that they don't need to go elsewhere to get.

benjamin
so what, Jeff has always said that SO is geared at programming in general.
Sam Saffron
@sambo: sure, but if SO were written in RoR, I'm sure you'd have given that as a positive ;-)
Mike Scott
+7  A: 

There are many reasons I would recommend learning RoR over MVC

  1. It's a much more mature stack. It's been around since 2005.
  2. You get to learn a new programming language. "They" say you should learn a new programming language every year.
  3. There is a very rich set of extensions to the base stack. Eg. HAML, Authentication gems, profiling and the list goes on and on.
  4. You get to use database migrations out of the box. Something that is a bit of a breakthrough in database configuration management.
  5. Dynamic languages give you a massive amount of flexibility.

That said: ASP.Net MVC is an awesome framework from Microsoft. I am not advocating dumping your stack and moving to the dark side. I just think it helps to have a broad understanding when it comes to technology.

Sam Saffron
+6  A: 

If you're familiar with the Microsoft stack (Windows, IIS, SQL, ASP.NET) but not so familiar with the Linux stack (Apache, MySql, etc), then going with ASP.NET MVC over Ruby on Rails will cost you a lot less in the long run, in time spent on learning infrastructure.

DSO
+3  A: 

I would recommend learning one at a time. The biggest part of of learning a new language or method of programming is learning the best practices and changing how you approach a programming problem. Not just the syntax. Jumping into two at once will leave you with bad habits in both.

Because you already know ASP.NET I think learning ASP.NET MVC would be the logical next step. Get a solid understanding of MVC concepts and THEN try a project or two in Ruby on Rails. The two frameworks approach some things differently. You may find that your style and preferences fit one better than the other. But either way, now you know both. Can't hurt right?

Mike L
+4  A: 

I suggest you take a look at the job market in your area, and choose what will increase your opportunities. Ruby on Rails is a great framework, but if nobody in your area cares or uses it, then it won't do you any good to learn it (speaking from a career perspective - there are lots of reasons it would benefit you from a learning perspective). I was faced with this dilemma recently and gave it a lot of thought; since my area is pretty much 99% .Net based and that's what companies want, I decided to focus on MVC and becoming an "expert" in ASP.NET instead of learning RoR, since there's no demand for RoR. I actually wasted two months learning RoR before I realized that it would help me personally, but not professionally.

That said, if you're planning on striking out on your own then choose whichever one you feel more comfortable with. If you already know Asp.Net though, I'd recommend taking a look at the MVC framework first since it leverages what you already know, but I heartily suggest looking at picking up Ruby, if not the Rails framework, since it's a very good scripting language for many tasks.

Wayne M
+2  A: 

However, I fail to see what is so great about these. Most of them sound basic (the kind you'll not really want to use in production code - scaffolding for example) - and most of them sound like they are there in ASP .NET MVC in some form or the other.

The ability to rapid prototype a website is part of what makes RoR so popular. When designing a website for a client there's a big difference between a non-functional mock and a functional mock.

I believe the feature gab between ASP.NET MVC and RoR will continue to get smaller. Eventually the choice will come down to a question of Windows vs LAMP.

I would spend a few weeks with RoR. It's extremely simple to get it installed and up and running so you can develop with it. Then it's just a matter of following a few tutorials until you've covered most of the basics. Then decide if you want to continue with RoR or stick with ASP.NET MVC.

Todd Smith
+2  A: 

if you already know c# and you were working with asp.net webforms, try asp.net mvc...and when you learn it, you can improve your skills with RoR as I am planning to...

cheers

Marko
funny. i'm "planning" to do exactly the same. But on a serious side, that's exactly the rationale behind my decision to go aspnetmvc - i already knew c# so i thought the learning curve with aspnetmvc would be smaller than ror.
cottsak
agree with you 100% :)
Marko
A: 

Personally I would invest the time in learning both. I have done this and although I ended up going with MVC for my current project, the decision was because I didn't have the time to invest in learning Ruby language. The RoR framework on the other hand you can get within a few nights and get going with webpages, validation, CRUD e.t.c. in no time at all. However when you need to start adding domain logic, learning about gems you may need to understand Ruby.

Another reason is I already have a hosting setup for Microsoft, and I know c# and the .net framework and the resources I'll need already so although it's less mature and isn't as feature-rich as RoR, I deduced I could get further faster with MVC.

To make the decision yourself, weigh all the options, spend a week with MVC ( use the book MVC in Action ) and spend a week with RoR (use the book Agile Web Development with Ruby on Rails 3rd Edition ) these will get you going within no time. Then when you decide on one or the other you will have a more knowledgeable perspective.

5x1llz
+11  A: 

I suggest you learn both!

I'm a professional ASP.Net developer by day, and a hobbyist RoR developer by night. Learning RoR will in fact make you a better .Net developer, and it's fun!

Also consider that one day you may in fact be able to write an ASP.NET MVC app in IronRuby instead of fussy old c# :)

Bayard Randel
I'm also an ASP.Net developer by and RoR developer by night, and you're totally right - they compliment each other nicely.
Barry Gallagher