Ruby on Rails vs ASP.NET MVC 3 for a. NET Guy?

我对 RoR 很陌生,我想在 ASP.NET MVC3和 RoR 之间选择。C # 对我来说肯定更容易,因为我已经做了这么长时间,但我想知道是否有任何意义,考虑使用 RoR 而不是 ASP.NET MVC 来开发一个真实的世界网站?

使用 RoR 还有什么是 ASP.NET MVC 3无法做到的,值得花时间去掌握 RoR?我认为可用的社区 RoR 插件是一个原因,但它似乎没有组织,似乎学习曲线做正确的事情将是如此之大,它实际上不会为一个新手节省很多时间!我可能是错的,我真的很感激你在现实生活中对此的评论?请注意,我还需要学习 ASP.NET MVC,但这听起来很快。网友!

RoR 能为。那个 值得选择 RoR 而不是 ASP.NET MVC 3的 NET 家伙?并请提出实际意见!:)

40649 次浏览

I use and like both, and the problem with a question like this is that they're so different that you could go on all day about apples vs. oranges, but since your question is pretty non-specific, I'll just say:

If you consider yourself "a .NET guy," then you should learn a language which works very differently than C#, and a dynamic language like Ruby isn't a bad place to start. (Another option would be a functional language like Haskell, Scala, etc.)

You will be a better programmer after you do, and you won't have to call yourself "a .NET guy" anymore!

Not a RoR dev here, but I do Django and I think the same question could be asked for Django as well. The #1 thing that I like Django over ASP.NET MVC is that Django comes with the ORM already. Which means most any code examples you'll find on the web will kind of follow a similar pattern. With ASP.NET MVC you can pick from lots of different ORMs which can be a good thing, but can also cause confusion.

Just like @Craig said though, it really is apples vs oranges. I'd pick ASP.NET MVC if I was required to deploy it on a MS stack, and use Django for "personal" projects or projects that required it on to be deployed on linux.

You mention in your response to craig Stuntz that you want the 'right option for the limited time you have'

Go with mvc3 and focus on learning just that, instead of a new language and framework at the same time. RoR is great, but its a new language, framework and IDE all at once and chances are you wont get it right first time. I didnt.

There are some really good tutorials on the asp.net website that will get you up and running very quickly

They are both fantastic, and can accomplish the same goals very quickly. I used a great book to learn a while back, and it would be right up your alley: Rails for .Net Developers

Also, I wrote a post about going from MVC to RoR a while back as well.

As for comparisons, they both have strengths as has been covered, but here are a few that stick out to me:

  • I really do like RoR's deployment and simple ways to push to live sites - no scripts to run at all, just a bit of command line should get you up and running once the code is actually written. If you choose RoR, UNDERSTAND THE COMMAND LINE COMMANDS - it will make your life so much easier!

  • As you mentioned, the plugins are great, and can really be used to speed things up.

  • As a .Net dev, MVC will be a breeze, I would recommend using Razor, as it is very simple and less cluttered than the old 2.0 non-razor rendering.

  • .Net's EF4 can be compared almost directly to RoR's ActiveRecord, great ORM systems tfor dealing with data.

  • I have found that .Net's documentation is a bit more consistent and thorough.

  • One problem I had with RoR was the rapid and drastic changes; not so long ago, they upgraded to 3.0 on my host, and I did not lock my version - all sorts of stuff broke until I figured out the new stuff (I should have frozen my version).

It is not a clean cut choice - both are great. As you are already a .Net dev, I would guess MVC3 would be the way to go, but both are easy to learn.