Play!Framework vs Ruby on Rails

胡国兴
2023-12-01

Play!Framework vs Ruby on Rails

Posted by Dillon in Programming

Over the past few months I’ve been playing a lot with web frameworks – and if you’re just starting out, let me tell you: there’s a lot of them. However, being that I typically work with me, myself, and I, it was easy to eliminate a lot of the frameworks that are more geared towards enterprise deployments and focus on those that provided rapid application development tools. I ended up playing a lot with Grails, Rails, Django, and Play!Framework – all of them very cool and impressive in their own right. However, the two that I ended up playing the most with were Play!Framework and Ruby On Rails and out of those two, I was most impressed by Rails. Let me tell you why.

在过去的几个月我已经用一些web框架——并且如果你刚刚开始,让我告诉你:它们有很多。然而,我通常就是自己一个人工作,所以很容易排除许多为企业开发而生的框架,而专注于使快速的开发工具。我最终用了一些包括Grails,Rails,Django和Play框架——凭它们自身的头衔它们都很酷并且令人印象深刻。然而,我最终大部分用Play框架和Ruby On Rails这两个而不用其他的,Rails使我印象最深刻。让我来告诉你为什么。


Praise for Play!

First off, the Play!Framework is incredibly impressive, especially for being relatively new. I wrote a web application for a group in EMC a few years ago with the 1.0 release – and even then, it was extremely easy to get going and manage. Play! is now on version 2.0 and sports a few beautiful features and a nice synergy between Java & Scala. If you’re a Java or Scala developer this is definitely the framework to keep a close eye on. Even better, Heroku just previously added support for Play!Framework applications in the cloud which makes deployment for this framework so so so easy.

赞扬Play

首先,Play框架是难以置信的令人印象深刻,尤其它是相对较新的。我曾用1.0版本为EMC写过一个web应用——并且即使那样,它非常容易运行和管理。Play现在是2.0版本,有完善的功能并且很好的结合Java和Scala。如果你是一个Java或者Scala开发人员,你要一直关注这个框架。更好的是,Heroku已经在云端加入对Play框架的支持,使这个框架的部署非常非常容易。

 

A Few Disadvantages of Play!

That being said, here’s the two things that drive me nuts about it: the lack of plugins and the lack of a proper IDE. While no fault of Play!’s, it’s hard to really develop applications quickly when you’re constantly re-inventing plugins that other frameworks have. Play! does have quite a few already (and will definitely continue to grow with time) but it in no way matches the sheer amount of plugins as Rails has. It’s like night and day when playing with both these frameworks simultaneously – Rails has a plugin for almost any feature you can think of. Finally, while it may seem comical that I complain about the IDE I believe it’s really important. Nothing upsets me more than the lack of proper code completion or syntax checking in this day and age.  The ScalaIDE has a lot of features and is probably the closest IDE to fully support Play!Framework that I’ve found it completely lacks support for code completion in the view. That’s really unfortunate.

Play的一些缺点

虽然这样说,它缺少插件和适当的IDE这两件事使我发狂。虽然Play没有缺点,但当你不断尝试其他框架的插件时,Play很难真正快速开发应用程序。Play的插件已经有了一些(并且肯定会随着时间而发展)但是它无法和Rails的插件的数量相比。当用两个框架的时候相当于白天和黑夜——Rails的插件几乎有你想到的任何功能。最后,虽然我抱怨IDE似乎很滑稽,但是我相信那真的很重要。在这个时代,没有什么会令我不安,除了适当的代码补全和语法检查。Scala的IDE有很多特点并且它可能是全面支持Play框架最接近的IDE,当我发现在视图中完全不支持代码补全,那真的很遗憾。

 

Some Bad Rails First!

Before I go off and sound like I’m another rails fan boy I want to share the things I dislike about rails: the Ruby language. When I started with Rails I never used Ruby before. It took some playing around with the language to learn the nuances and get a hang of it. However, I’m not sure exactly why, but coming from a C++, C#, Java kind of background it makes me feel odd when I’m writing ruby code. Given Python or Ruby to write a desktop application I would most likely always choose Python. If you choose to play around with Rails, or even use it for your next project, make sure you fully understand Ruby before you jump in; because you don’t want end up struggling with the language while at the same time struggling with getting your web app out the door.

首先Rails不好的一些
在我听起来像另一个rails的粉丝之前,我要说说我不喜欢rails的东西——ruby语言。我试图
鉴于Python或Ruby编写一个桌面应用程序我可能多半选择Python。如果你选择用Rails,或者甚至在下一个项目使用它,在你进入项目之前确保你足够了解Ruby;因为你不想最后挣扎的语言同时挣扎web应用的发布。

 

Choo Choo: Rails!

Right off the bad, the biggest benefit to using Rails is the gems. They’re wonderful, plentiful, and so easy to install. They truly make your life easier when you’re whipping together a project. Not only that, but the community is quite large. Rails has been around for a while so there is always someone to help you out of a jam and their documentation is pretty solid. Another factor I really enjoy about rails is that it abides by convention over configuration, which allows Rails to make a lot of magic happen automatically (sometimes without the developers knowledge of how, or why it is doing that). In addition, the fact that you can pretty much override every convention in some way shape or form makes it pretty easy to manage – although a typically do not override any of Rails’ conventions. Finally, I come to the IDE: RubyMine. The company JetBrains really makes some nice software and this IDE is sweet! There’s so many features packed into this IDE that makes coding so easy. Especially because it s specifically designed around Rails! If you choose to develop a Rails application, definitely look into RubyMine.

Rails

Rails最大的好处是可以使用Rails的gem包。它们非常奇妙,丰富,并且非常容易安装。当你被一个项目困扰时,它们真正的使你的生活变的简单。不仅如此,它的社区相当大。Rails已经存在一段时间,所以社区中通常会有人帮你走出困境并且他们的文档是相当可靠的。我非常喜欢Rails的另一个原因是它约定优于配置,它允许Rails大量的自动生成(有时以开发者的知识不知道怎么了,或者为啥这样做)。此外,事实上你几乎可以用一些模型或者表单覆盖每一个约定,使它非常容易管理——尽管不覆盖任何一个约定。最后,我使用RubyMine这个IDE。JetBrains公司生产了一些不错的软件并且这个IDE非常贴心!这个IDE有非常多的功能使编码非常容易。尤其因为它是为Rails专门设计的!如果您选择开发一个Rails应用程序,肯定会研究RubyMine。

 

Conclusion

Until the amount of plugins for Play! increases to where I can typically find what I’m looking for without having to hack together something and a proper IDE is released with full support for all of Play! I will be sticking with Rails. Rails has a huge amount of plugins, RubyMine is an unsurpassed IDE for rails, and the amount of time to throw a decent looking product together is almost unmatched in any other framework. Go with Rails!

总结
直到paly的插件增长到我通常能找到我要找的东西,而不是自己整些东西组合到一起,并且有一个适当的IDE支持play的所有版本我将坚持用Rails。Rails有大量的插件,对于Rails,RubyMine是一个非常卓越的IDE,并且时间见证了这个产品是其他框架无法比拟的。和Rails走起!


原文地址:http://www.dillonbuchanan.com/programming/playframework-vs-ruby-on-rails/

 类似资料: