铁轨上的Python?
是否可以将 Ruby on Rails 代码库转换为 Python?
我认为很多人比 Ruby 更喜欢 Python,但发现 Ruby on Rails 的功能(整体上)比 Python Web 框架中的功能更好。
那么,这可能吗?或者 Ruby on Rails 是否利用了难以转换为 Python 的特定于语言的功能?
Would it be possible to translate the Ruby on Rails code base to Python?
I think many people like Python more than Ruby, but find Ruby on Rails features better (as a whole) than the ones in Python web frameworks.
So that, would it be possible? Or does Ruby on Rails utilize language-specific features that would be difficult to translate to Python?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是一篇很棒的博客文章。 Rails 开发人员选择了一个框架,然后才想到使用 Ruby 进行编码。
Python 开发人员选择语言是为了语言,而不是框架。另一方面,这大大降低了框架的进入门槛。
This is a great blog post. Rails developers chose a framework, and coding in Ruby is the afterthought.
Python developers chose the language for the language, not the framework. On the other hand, that made a lot lower bar to entry for frameworks.
Rails 中使用的许多方法已被翻译到 Django 中。你尝试过吗?
http://www.djangoproject.com/
Many of the methodology used in Rails has been translated into Django. Have you tried it?
http://www.djangoproject.com/
我认为人们喜欢 RoR 的原因之一是领域特定语言 (DSL) 的编程风格。这是 Ruby 比 Python 更擅长的地方。
I think one of the things that people like about RoR is the domain-specific language (DSL) style of programming. This is something that Ruby is much better at than Python.
我知道 Rails 本身不一定 = MVC,但我认为 Rails 高效的很多原因是它强制(嗯,强烈鼓励)MVC 开发,所以如果您寻找 Python MVC,您可能会发现类似的东西,例如Stack 上的上一篇文章:什么是好的轻量级 Python MVC 框架?
那里有很多 Python MVC 框架,但我不断听到很多关于 Django 的信息 (http://www.djangoproject .com/),所以在我看来,这绝对应该出现在你要查看的事情清单上。
I know that Rails does not necessarily = MVC per se, but I think a lot of what makes Rails productive is that it enforces (well, strongly encourages) MVC development, so you might find something similar if you look for Python MVC, such as this previous post here on Stack: What's a good lightweight Python MVC framework?
There are lots of Python MVC frameworks out there, but I keep hearing a lot about Django (http://www.djangoproject.com/) so that should definitely be on your list of things to check out IMO.