开发者

ASP MVC3 vs Ruby on Rails

开发者 https://www.devze.com 2023-02-25 09:36 出处:网络
I have mainly developed in the .NET world, but I have a project coming up which needs to really favor the front end.Lots of UI love.

I have mainly developed in the .NET world, but I have a project coming up which needs to really favor the front end. Lots of UI love.

Is there value in using to Ruby On Rails instead of MVC开发者_JAVA技巧3? How should I go about choosing between the two? Are there other options worth looking at?

I know Ruby On Rails is pretty popular, but how does it differ from MVC3?


Is there value in using rails instead of mvc3?

YES. If nothing it will give you a different perspective and broaden the way you think about programming problems. There's something about the terseness of ruby, usefulness of blocks, and dynamic behavior of the language that allows you to really think differently.

How to choose between the two?

If the project is a short one then stick with what you know. But if it'll end up being a longer project it might be worth the effort to start digging into the learning curve of rails. Most people will tell you that rails is faster to develop in than .net mvc. If the project is long enough, you might end up being able to develop faster on rails once you get comfortable with it.

That being said, the learning curve for a Microsoft programmer can be STEEP! If you're a unix guy then it wont be so bad but if not, get ready to learn about a LOT of different topics. The command line and your shell, TDD, homebrew or macports, git instead of subversion, gems, bundler, rvm, rspec or some other testing framework, etc.

Also, if you don't own a mac or aren't on some flavor of *nix then you might want to stick with .net. From what I hear it's a painful experience developing rails on windows.

If TDD is important to you then rails is the way to go. Also deployment is much easier on rails.

The ecosystem is something that might be a factor if you like to use tools built by others. Rails has a huge base of open source developers that contribute a lot back to the community. If you want to compare take a look at github.com (for rails) and codeplex (for microsoft). However, with Microsoft's NuGet system maybe the Microsoft side will start creating a better ecosystem. But right now it's not even close.

Other options worth looking at?

If you need to develop a pretty dynamic, database backed website then rails or .net mvc are good options. If it's something much simpler/smaller then some simpler/smaller frameworks are sinatra (for ruby) or webmatrix for .net. You'll be able to get up to speed much quicker with these frameworks.

How do the two frameworks differ?

The biggest difference I notice are from the underlying langues, ruby for rails and c# for .net mvc. Ruby is dynamic while c# is static. Rails is not compiled while .net mvc is. You'll get more raw performance out of .net mvc.

Rails is really built with TDD and BDD in mind. The last time I used .net mvc 1.0 it was really hard to do TDD.

When developing, pretty much everyone on .net mvc will use Visual Studio but I'd say most rails developers don't use an IDE. They just use a simple text editor (textmate, vim, emacs) and debug using the console.

EDIT: *Bonus tips*

If you want to get started with rails (which I highly recommend) the easiest and most thorough way is to go through the rails tutorial by Michael Hartl. In it you'll learn about ruby/rails along with the following

  • git - source control
  • rvm - for running different versions of ruby on the same computer
  • rspec - for TDD
  • heroku - free web hosting with SIMPLE deployment

Once you get a good understanding of rails you'll want to improve your ruby skills to really become a good rails developer.


Ruby and RubyOnRails sounds like it would fit the bill.

And if you really wanted, you could use IronRuby for .NET goodness.

As for justification - many successful sites have been written with the framework. It has a proven track record over MVC3.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号