Skip to main content

Playframework vs Ruby On Rails



Yet another LanguageX vs LanguageY question....





Currently I have a bunch of apps built on playframework . For the most part I love it. Moving from PHP a few years ago was almost a religious experience -- an actual functional orm, much less boiler plate code, stuff just worked, etc.





I still have a website running on a a shared hosting service thats built with PHP+ CodeIgniter . Recently I've been adding some features to this site and have been thinking about porting it to either Ruby on Rails or Playframework.





So far though, nothing about rails has really blown me away. It seems like it has pretty much the same featureset as playframework. I like ruby's terseness, and things like blocks, but again for the most part there's been nothing about the language itself that has made me go "oh wow this is 1000x better than java/php/c/whatever!" In fact, some parts actually kind of rub me the wrong way -- I prefer strongly-typed languages for example.





My question is, am I likely to find anything in the framework or language that's really going to differentiate it from java+play for me, or are they pretty much the same and primarily just differentiated by things like personal preference about syntax and developer community?


Comments

  1. Play framework is gracious enough to acknowledge RoR's inspiration. (Unlike some people who copied an entire platform and give absolutely no credit to the original)

    If Play team have done a good job, it's no wonder that a person is not impressed by RoR if he learned Play first. So if you find Play quite comfortable, there's no compelling reason to go RoR.

    ReplyDelete
  2. Play is inspired by Rails frameworks so yes it looks like RoR and Django and Symfony for example... I tried php but I'm not really found of this language even if it brought really good things to the web world... Ruby is also the kind of language I don't really like and as it is said above, it is purely subjective :)... But I also admit it brought really good things in the web world...
    I really prefer Python as a language... Anyway, my skills in Java are far better than in Python and for years, I've desperately tried to find a good web framework in Java not being an horrible heavy-weight JEE/Spring-like stack... I tried Grails and I was quite happy but it has 2 drawbacks to my mind: groovy is really a nice scripting language (I would love to see lots of it in Java directly) but it's not really quick and Grails is based on Spring and it's not much lightweight anymore... Basically, I spent lots of time on Grails but as I wanted to develop an application in Google App Engine, I quit Grails simply because it was too heavy to run on GAE...
    Then, I found Play! and I was amazed to discover it! Really! It is one of the best thing I've seen in Java for some time... really light, really stateless, on-the-fly class recompiling/loading, no deployment required while developing, no huge dev tool required, module+plugin mechanism etc... Moreover Play! has a really dynamic community.

    I don't say everything is perfect but it's evolving and getting better and better. I've been hammering Play! for one year now and I've never been stopped by the framework as I were when using all other java frameworks: I'm just limited by my ideas and my skills sometimes ;)

    So if you like Java, I would really advise taking some time to investigate Play! ;)

    ReplyDelete
  3. Ruby never called my attention, ever... even with the launch of RoR I still was using PHP (with Zend Framework at that time)

    Having used CakePHP and Zend Framework and comparing it to Play! in my experience starting a project with Play! is so MUCH painless than those frameworks I mentioned above, once you know the basics of Play! you will feel productive, the community is always there to back you up (although just searching the mailing list you can already find the solutions)

    With CakePHP, I'm sorry but the console stuff is both confusing and weird the configuration is ok but nothing beats the routes file Play! provides, write your routes fast and continue, ZF is still pretty straight-forward but you will feel like you spent hours configuring it just to get started.

    The only thing that could stall you is the lack of knowledge in Java, but as you go and adapt it will become easier.

    Note, Play! is not perfect, the version 1.2 is coming soon, although 1.1.1 is really pretty stable to use.

    Go ahead and play with it, even if we tell our experiences with Play! it depends on how comfortable you feel with the framework.

    one last thing... I'm wondering... are you porting your site because PHP lacks something or just to jump to another language? also my opinion might be a tad biased, but hey like I said, try it and see how it goes :)

    ReplyDelete
  4. I think that if you prefer strong typed languages, and are looking for an experience similar to rails, right now you don't have many choices, the only thing that comes up to my mind is play. (BTW there's an alternative strong typed template engine, japid, that uses java instead of groovy)

    I think one of the most important differences you'll find comes from the maturity of both frameworks. Rails has a really huge community, with lots of books, sites, blogs, plugins, tutorials and examples. More over, it's code base is well known by many contributors, and after it's merge with merb it has become more modular...

    On the other hand play's community is extremelly helpful and dynamic, and it's growing day by day, but it still is a young project...

    Java affordable hosting can also be a problem...

    But if you have already made your experience with play, and are fond of strong typed languages, I would advice you to go with play...

    More over, when the scala module matures, you'll have more rails-like magic with a strong typed laguage like scala...

    --

    edit: Java hosting is on it's way to become a non issue also, in the last weeks, many options appeared, specially related to cloud offerings, have a look at Experiences on free and low-cost hosting for play framework applications?. red hat's openshift is another alternative that is coming strong, see: http://community.jboss.org/blogs/thomas.heute/2011/08/12/lets-play-on-the-red-hat-cloud-using-the-play-framework-on-openshift-express-and-jbossas7

    ReplyDelete
  5. This is subjective, but I didn't like Play! when I looked at it. If you like staying on the JVM, I'd suggest looking at Grails.

    EDIT:

    When I say that I just didn't like Play, a good summary is provided here:


    Play! is designed to be comfortable for developers coming from scripting languages like Python and PHP. It provides its own build system and management scripts, somewhat like Rails or Django would. Existing build tools and infrastructure (like the Maven repositories commonly used for dependency management in Java-land) will not integrate well with Play.


    Not letting Java developers use Maven would be like telling someone to use Maven for a Rails project to manage dependencies instead of gems - it just feels unnatural. That's why for the JVM I'd suggest Grails (for Groovy) or Spring MVC or Roo for plain old Java.

    ReplyDelete
  6. One main point of differenciation between RoR and Play! is that Java supports Multithreading by default, whereas Ruby does not. So in the long term, for running really processing massive amounts of information, Play! will reign over RoR. And Play! combined with Japid and Netty will give you one heck of a performance.

    ReplyDelete
  7. Foreword:

    I have developed apps in both frameworks (play 1.2X branch and Rails (2branch & 3branch).

    My personal opinionated advice:

    Just stick with the one you know best.
    I personally prefer the play stack as it comes with a really nice ORM layer and the java language has better compatibility with my brain.
    Keep in mind that the plugin ecosystem for play isn't that mature compared to the overwhelming range rails developers are offered.

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.