Question

I'm considering using Grails for a new website, but am open to other/new programming languages and frameworks. I have done development using J2EE/JSF2, ASP.NET, and PHP. Is Grails or Ruby on Rails pretty much the best way to get functionality up and running quickly?

Some initial thoughts:

  • DJango looks similar to RoR/Grails and I'd consider it
  • GWT is an interesting concept but it doesn't seem like turnaround time is quite as fast

Thanks, -Jon

Was it helpful?

Solution

As with all questions of this sort, the answer is "it depends". Factors to consider include how comfortable you are with the language/framework and what features the project requires. Having said that, I've built sites using a number of frameworks, each with its own strengths and weaknesses:

Grails

If I need to get a site up quickly for anything professional, Grails would probably be my first choice. GORM is far and away the simplest and most intuitive ORM that I've tried, the MVC paradigm is very well executed, there is 0 configuration to start coding (no worrying about URLs, DB patches, anything), very rapid iteration (just refresh the page), seamless Java integration (a good thing in the business world), and some wonderful plugins (e.g. Searchable is a thing of beauty). Biggest downside is that hosting can be tough to find (and expensive).

Ruby on Rails

My experience with RoR is very similar to that of Grails: MVC well executed. On the positive side, it has a bigger community, so the online resources (documentation, FAQ, code samples, etc) are very plentiful, there are TONS of plugins, Ruby is a bit more flexible/expressive/"funky", and it's much easier to find hosting (esp. for personal projects); on the negative side, the dependency management/setup sucks (I've used RubyGems on Windows, Ubuntu, Fedora and OSX and ran into non-trivial problems on each one), there is slightly more configuration/overhead than Grails (in particular, dealing with routes.rb and tons of db migration files), and apparently, RoR has some serious scalability issues.

PHP (including the CakePHP framework)

If I need to quickly hack something out or build a site for personal uses, then I'd probably go with PHP. PHP is far and away the easiest language to learn and deploy: download any of the convenient LAMP packages out there, click a couple times, and begin hacking away. The community is bigger than that of RoR, so documentation is plentiful and there are countless plugins (easily "installed" by just dropping in the php file and refreshing the page). The language is simple to learn, but some things in PHP are just downright strange and it takes a lot of discipline to avoid ugly code. The CakePHP framework enforces a nice MVC paradigm to help keep things orderly, and for the most part is on par with RoR, although I personally found it slightly more unintuitive.

Java (servlets, JSPs, JSTL, struts, Velocity)

I've built many sites using the Java servlet technologies, and I can honestly say that there is no good reason to pick them for any new site nowadays. They have a steep learning curve, tons of configuration to fight with (XML hell), slow iteration due to the need to redeploy stuff all the time (unless you use JRebel), verbose code, and no "freebies" in terms of functionality. I've played around with the Play! Framework and Spring Roo a little bit and both are doing some very cool stuff with more or less "pure" Java code and are worth looking into further.

OTHER TIPS

When using CakePHP, I can spin up a web app faster than... a... really fast guy. Anyway, it's fast. Drop the files in your web root folder, configure two files (about three lines to change in each). And start coding.

Because it favors convention over configuration it will take some experience to ensure that it's configured optimally, but I guarantee that with equal levels of experience, CakePHP sports the most rapid deployment out of any framework, probably period.

That said, the original CakePHP project was a PHP clone of rails (it isn't anymore), so I'm sure rails is quick to deploy as well.

I've been working with ASP.NET MVC framework for some time now, and I've found it to be a pretty darn good framework. Extremely easy to use, especially if you're familiar with .NET. The framework has been growing quickly since its release in 2009, MVC 3 preview has been released to the public recently. I think MS is doing all the right things with the ASP.NET MVC framework.

I haven't used everything, but Rails is pretty darn fast. I expect Grails is too as it embodies the DRY philosophy pretty well. I don't know enough about other dynamic language frameworks to say.

Even with good code generation strategies my ASP.NET (webforms) don't seem as efficient.

I've dabbled in Django and Rails and found Rails to more of my liking. That being said, I prefer ASP.Net MVC 2 much better than Rails. I'm much faster in MVC (or even just web forms) than Rails simply because my mind "works better" with C#.

To me it comes down to what you know and what you enjoy. I've heard from many people that Ruby is fun, not to me it isn't. C# is fun! Haskell is fun! If you don't enjoy the language/framework then you won't be as fast as a "slower" framework you enjoy.

Licensed under: CC-BY-SA with attribution
scroll top