ASP MVC3 与 Ruby on Rails

发布于 2024-11-01 04:58:16 字数 169 浏览 1 评论 0原文

我主要在 .NET 世界中进行开发,但我正在开发一个需要真正支持前端的项目。很多用户界面的爱。

使用 Ruby On Rails 而不是 MVC3 是否有价值?我应该如何在两者之间进行选择?还有其他值得考虑的选择吗?

我知道 Ruby On Rails 非常流行,但它与 MVC3 有何不同?

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 MVC3? 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云朵有点甜 2024-11-08 04:58:16

使用 Rails 代替 mvc3 是否有价值?

是的。如果没有的话,它会给你一个不同的视角,并拓宽你思考编程问题的方式。 ruby 的简洁性、块的实用性以及语言的动态行为让您能够真正以不同的方式思考。

如何在两者之间进行选择?

如果项目很短,那么就坚持你所知道的。但如果它最终成为一个更长的项目,那么可能值得努力开始深入研究 Rails 的学习曲线。大多数人会告诉您 Rails 的开发速度比 .net mvc 更快。如果项目足够长,一旦您适应了它,您最终可能能够在轨道上更快地开发。

话虽如此,微软程序员的学习曲线可能非常陡峭!如果你是一个 Unix 爱好者,那么情况不会那么糟糕,但如果不是,请准备好了解很多不同的主题。命令行和你的 shell、TDD、homebrew 或 macports、git 而不是 subversion、gems、bundler、rvm、rspec 或其他一些测试框架等。

此外,如果你没有 mac 或不喜欢某种风格如果是 *nix,那么您可能想坚持使用 .net。据我所知,在 Windows 上开发 Rails 是一次痛苦的经历。

如果 TDD 对您很重要,那么 Rails 就是您的最佳选择。此外,在轨道上部署也更加容易。

如果您喜欢使用其他人构建的工具,生态系统可能是一个因素。 Rails 拥有庞大的开源开发人员基础,他们为社区做出了很多贡献。如果您想进行比较,请查看 github.com(针对 Rails)和 Codeplex(针对 microsoft)。然而,有了微软的NuGet系统,也许微软方面将开始创建一个更好的生态系统。但现在还差得很远。

其他值得考虑的选项?

如果您需要开发一个非常动态的、数据库支持的网站,那么 Rails 或 .net mvc 是不错的选择。如果它是更简单/更小的东西,那么一些更简单/更小的框架是 sinatra(用于 ruby​​)或用于 .net 的 webmatrix。您将能够更快地熟悉这些框架。

这两个框架有何不同?

我注意到的最大区别是底层语言,ruby for Rails 和 c# for .net mvc。 Ruby 是动态的,而 C# 是静态的。 Rails 未编译,而 .net mvc 已编译。您将从 .net mvc 中获得更多原始性能。

Rails 在构建时确实考虑到了 TDD 和 BDD。上次我使用 .net mvc 1.0 时,TDD 真的很难做到。

在开发时,.net mvc 上的几乎每个人都会使用 Visual Studio,但我想说大多数 Rails 开发人员不使用 IDE。他们只使用简单的文本编辑器(textmate、vim、emacs)并使用控制台进行调试。

编辑:
*额外提示*

如果您想开始使用 Rails(我强烈推荐),最简单、最彻底的方法是浏览 Rails 教程,作者:Michael Hartl。在其中,您将了解 ruby​​/rails 以及以下内容

  • git - 源代码控制
  • rvm - 用于在同一台计算机上运行不同版本的 ruby
  • ​​ rspec - 用于 TDD
  • heroku - 免费网络托管,部署简单

一旦您对 Rails 有了很好的了解您需要提高 Ruby 技能,真正成为一名优秀的 Rails 开发人员。

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.

胡渣熟男 2024-11-08 04:58:16

Ruby 和 RubyOnRails 听起来很符合要求。

如果您确实想要,您可以使用 IronRuby 来获得 .NET 的优点。

至于理由——许多成功的网站都是用该框架编写的。它拥有超过 MVC3 的良好记录。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文