Rails vs Grails

Hi, are there any really unbiased comparisons between rails and
grails, and to which each framework is better suited for?

I’m coming from a java background, but I am not against using a non
java solution if it’s actually better. I am a little concerned with
performance though. The site needs to really work well with 200,000
visits a day, and that’s going to grow.

I started to use grails, and it’s all well and good, but there’s some
things i don’t like about it.

  1. The tests take forever to run

  2. IntelliJ IDEA reports integration tests as passing and displays a
    green light, even though they fail. The test output stinks, so running
    them on the command line and checking an html test results file is the
    only thing you can do. This is awful.

  3. Apparently saving a domain class that violates constraints does not
    throw an exception when testing. I can understand for production
    saves, but for tests?! It is so important to get good feedback rather
    than silence failures that do nothing. Maybe over time, I will just
    “know”, but I can hardly see how silent failures are more productive.
    I spent 30-45 minutes wondering why the test was failing because it
    looked totally fine and mirrored the examples.

  4. It has slow code->browser cycles… and sometimes you gotta restart
    tomcat anyway because the class loading blows up. It happens a lot
    more than they say it does.

The one thing I have against rails/ruby is that I hate their method
names. Underscores are confusing to me because they sort of look like
operators. Maybe can get used to this, but I hate methods like to_s
for toString. That stuff is going to drive me nuts.

Anyway, our site has to support a lot of traffic, requires a lot of
cron-like stuff built into the application, and we’ll need to support
relational databases and something like cassandra.

Suggestions?

On 20 May 2010 07:10, egervari [email protected] wrote:

Hi, are there any really unbiased comparisons between rails and
grails, and to which each framework is better suited for?

Rails is better suited to people that know Ruby but not Java.
Grails is better suited to people that know Java but not Ruby.

I started to use grails, and it’s all well and good, but there’s some
things i don’t like about it.

I’d suggest taking these issues up on a Grails mailing-list might get
you some constructive ideas as to how to overcome them.

The one thing I have against rails/ruby is that I hate their method
names. Underscores are confusing to me because they sort of look like
operators. Maybe can get used to this, but I hate methods like to_s
for toString. That stuff is going to drive me nuts.

Personal preference certainly plays a big part in any platform choice;
but there’s hardly a lot our input can do about whether you “like”
underscores or not.

Anyway, our site has to support a lot of traffic, requires a lot of
cron-like stuff built into the application, and we’ll need to support
relational databases and something like cassandra.

You can write poor-performing or well-performing applications in either.

Unfortunately for your quest to make a decision, both Rails and Grails
support relational databases and “things like cassandra” (as well as
cassandra specifically), so that’s not edging either of them toward a
preference.

Michael P. wrote:

On 20 May 2010 07:10, egervari [email protected] wrote:

Hi, are there any really unbiased comparisons between rails and
grails, and to which each framework is better suited for?

Rails is better suited to people that know Ruby but not Java.
Grails is better suited to people that know Java but not Ruby.

The information I have come across from people who know both frameworks
and languages well is that Rails is better designed and easier to work
with than Grails.

My former boss wrote probably the largest Groovy project in the history
of the language. He later switched his business over to being a Rails
consultancy. I think it’s significant that with all his Groovy
experience, he didn’t choose Grails.

I started to use grails, and it’s all well and good, but there’s some
things i don’t like about it.

I’d suggest taking these issues up on a Grails mailing-list might get
you some constructive ideas as to how to overcome them

Yes, indeed.

The one thing I have against rails/ruby is that I hate their method
names. Underscores are confusing to me because they sort of look like
operators. Maybe can get used to this, but I hate methods like to_s
for toString. That stuff is going to drive me nuts.

Personal preference certainly plays a big part in any platform choice;
but there’s hardly a lot our input can do about whether you “like”
underscores or not.

To the OP: you think an underscore looks like an operator? What
operator does it look like? What are you in danger of confusing it
with?

Personally, I’d rather use underscores. Their width looks more like
spaces and lets me parse words more quickly. I find that
my_variable_name reads almost like spaced text, whereas myVariableName
looks clunky, computerish, and undifferentiated. (Larry Wall basically
said the same thing in one of his Perl style guides, FWIW.)

Anyway, our site has to support a lot of traffic, requires a lot of
cron-like stuff built into the application, and we’ll need to support
relational databases and something like cassandra.

You can write poor-performing or well-performing applications in either.

Unfortunately for your quest to make a decision, both Rails and Grails
support relational databases and “things like cassandra” (as well as
cassandra specifically), so that’s not edging either of them toward a
preference.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

The information I have come across from people who know both frameworks
and languages well is that Rails is better designed and easier to work
with than Grails.

My former boss wrote probably the largest Groovy project in the history
of the language. He later switched his business over to being a Rails
consultancy. I think it’s significant that with all his Groovy
experience, he didn’t choose Grails.

That is interesting.

To the OP: you think an underscore looks like an operator? What
operator does it look like? What are you in danger of confusing it
with?

Part of the problem for me is that I really can’t see well. this-that
and this_that kind of look the same to me.

Also, I do a lot of scala recently. That language uses _ as a
wildcard, so using _ in variable names (even though that isn’t very
idiomatic of the platform) would be incredibly confusing.

Anyway, I can probably live with the underscores even though I’ve been
typing camelCase for 10+ years. The API is the real worry. I don’t
like how many of the methods/functions are named. I think, was it
really so hard to call to_s to_string? When I type in an IDE, I
literally type “t” and press ctrl-space and select the method I want.
I can ctrl-shift-space and it’ll just guess and type the rest of it
for me.

Personally, I’d rather use underscores. Their width looks more like
spaces and lets me parse words more quickly. I find that
my_variable_name reads almost like spaced text, whereas myVariableName
looks clunky, computerish, and undifferentiated. (Larry Wall basically
said the same thing in one of his Perl style guides, FWIW.)

Part of this is experience. If you’ve been using perl, php, etc., then
the underscores look okay. If you haven’t, then they don’t.
Consistency is the key. That’s also my problem with them. In PHP, you
never know if it’s “teardown” or “tear_down”. There are so many
problems with the API in PHP that it just left a massive sour taste in
my mouth. Of course, the same problem happens with camel case, but the
ide support for java has been much better than php, so it was less of
a problem :wink:

On 20 May 2010 12:59, Marnen Laibow-Koser [email protected] wrote:

My former boss wrote probably the largest Groovy project in the history
of the language. He later switched his business over to being a Rails
consultancy. I think it’s significant that with all his Groovy
experience, he didn’t choose Grails.

The decision could have been based solely on business grounds, not
technical
grounds.

People have heard of Rails, there is ‘brand awareness’ for Rails, so you
more likely to be able to get clients. Or at least it would be easier
convincing them that Rails is what they want rather than something
called
Grails that no one has heard of. Even the dimmest PHB has heard of Rails
and
that it is HOT

Not saying that there aren’t technical reasons to reject Grails but on
purely business grounds Rails is king. So your former bosses decision
might
not be a reflection as to the technical merits of Grails.

purely business grounds Rails is king. So your former bosses decision might
not be a reflection as to the technical merits of Grails.

When it comes to performance, how is Rails? Like if I were to design a
raw Spring/Hibernate app, which I’m not going to… but let’s say I
did. What is the comparative performance with something like that,
even though it probably isn’t a fair comparison.

Also, how well to do the tests run? Imagine a system with a few
thousand unit/integration tests. How long will it take to get all the
tests to run?

Is it hard to build cron-like events in rails/ruby? Can I do that
inside of my app where it’s hosted? In the java world, we have quartz
to do this (and probably some others).

Also, is it a good idea to use rails 3.0 even if it’s in beta if the
app is not going to production for awhile?

Thanks!

On 20/5/2010 8:26 PM, Peter H. wrote:

Not saying that there aren’t technical reasons to reject Grails but on
purely business grounds Rails is king.

How long has the Rails community waited to hear the second half of that
statement!

Best Regards,
Mohit.
20/5/2010 | 8:54 PM.

egervari wrote:

purely business grounds Rails is king. So your former bosses decision might
not be a reflection as to the technical merits of Grails.

When it comes to performance, how is Rails? Like if I were to design a
raw Spring/Hibernate app, which I’m not going to… but let’s say I
did. What is the comparative performance with something like that,
even though it probably isn’t a fair comparison.

Rails can perform quite well. Hulu and Ravelry are both known for being
high-traffic Rails sites with excellent performance.

Also, how well to do the tests run? Imagine a system with a few
thousand unit/integration tests. How long will it take to get all the
tests to run?

It depends. On lots of things.

Is it hard to build cron-like events in rails/ruby? Can I do that
inside of my app where it’s hosted? In the java world, we have quartz
to do this (and probably some others).

I believe there’s a gem for this, though I’ve never tried to do it.

Also, is it a good idea to use rails 3.0 even if it’s in beta if the
app is not going to production for awhile?

I wouldn’t quite yet, particularly if you’re not familiar with Rails or
Ruby.

Thanks!

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On 20 May 2010 13:45, egervari [email protected] wrote:

When it comes to performance, how is Rails? Like if I were to design a
raw Spring/Hibernate app, which I’m not going to… but let’s say I
did. What is the comparative performance with something like that,
even though it probably isn’t a fair comparison.

Sorry I do not have sufficient experience to help you with this.

Also, how well to do the tests run? Imagine a system with a few
thousand unit/integration tests. How long will it take to get all the
tests to run?

This depends on your tests. A massive amount of badly written tests are
going to take a long time to run regardless of the language. The choice
of
language is not going to mitigate bad design or coding.

Is it hard to build cron-like events in rails/ruby? Can I do that
inside of my app where it’s hosted? In the java world, we have quartz
to do this (and probably some others).

We (where I work) are a Linux shop and we use cron extensively to push
and
pull data to keep our systems up to date.

Here is the plugin we use
http://github.com/PeterHickman/Crons-for-Railsthere is also some bits
and pieces on my blog if it might help (
http://peter-hickman.blogspot.com/ )

There are other tools but this deploys the crons with the site using
capistrano and installs them all in one go. Works for us.

Also, is it a good idea to use rails 3.0 even if it’s in beta if the
app is not going to production for awhile?

To be honest we haven’t even looked at 3 yet. I’m pretty sure that we
have
at least one 2.0.X site still running. I would base your decisions on
what
is available now, it’s not like all the Rails 2.X code is going to
suddenly
stop working the day 3 goes live.

On 20 May 2010 13:38, egervari [email protected] wrote:

To the OP: you think an underscore looks like an operator? What
operator does it look like? What are you in danger of confusing it
with?

Part of the problem for me is that I really can’t see well. this-that
and this_that kind of look the same to me.

You might want to try to change the font in your editor to one that is
designed to be easy to differentiate similar characters.
Personally, I use ProFont Tweaked [1], but Sheldon is good too.

[1] http://www.tobias-jung.de/seekingprofont/
There is a “linux” version, but I just have the Windows TFF
installed in Ubuntu

On 21 May 2010 09:58, Michael P. [email protected] wrote:

TFF

TTF… silly fingers :-/

Hi,

On 20 May 2010 08:10, egervari [email protected] wrote:

Hi, are there any really unbiased comparisons between rails and
grails, and to which each framework is better suited for?

Having worked with both extensively, though a lot more with Grails as
of lately, I dare say that it all boils down to a matter of personal
taste. There is no way to objectively say which one’s better.

Each has its own advantages and gotchas. There are things which are
very easy with Grails (as in ‘install plugin and your done’) like
implementing login facilities or running jobs. However, there are also
things that are equally easy with Rails which are not so easy with
Grails.

At my company we mostly use Grails and for very good reasons but there
sure are just as many good reasons for using Rails.

  1. The tests take forever to run

This is a well-known problem. The cause for this is JVM startup time.
For the time being Grails offers an interactive mode that starts a JVM
and allows you to run commands like test-app without incurring a JVM
startup penalty for each run. Besides, the Grails team is also working
on improving testing in various ways for the next major release.

  1. It has slow code->browser cycles… and sometimes you gotta restart
    tomcat anyway because the class loading blows up. It happens a lot
    more than they say it does.

This used to be a problem with 1.0.x and 1.1.x but shouldn’t really
occur anymore nowadays. At least it doesn’t for us and we do a lot of
Grails development


Best regards,
Björn Wilmsmann

I’m on the same situation, I know both Java and Ruby, and I am looking
for a language that I could use both for administration scripting and
web sites,

I tried a little bit both of Grails and Rails

Rails is easer to use, but it looks like LOTS of plugins/gems are no
more compatibles with the lasts versions of Ruby (1.9.2) and Rails
(3.0.1) (ex: the Qt4 binding for ruby), but I hope this will change with
time :slight_smile:
Another thing that I don’t really like about Rails is that I don’t feel
like if I had control on the web stack, most of things are “magic” and I
don’t always understand what it does on the background…
But rails has a perfect caching system and clustering way (memcached!),
it’s also very easy to profile and debug.
And the most important: There is a HUGE community !

Grails also has some advantages, it’s template engine if perfect (GSP)
(I like it really more than ERB, tag based templates are more clean),
and it includes ACEGI (the perfect authentication engine ;p) but the
caching system is really really poor (if not inexistent) and it’s harder
to cluster (Terracotta), there is almost nobody on the IRC channel
(nobody speaks or ask questions) and the most important thing: GRAILS
LOVES RAM! (~500MB of RES memory for a simple blank web site
deployment…),
another thing non related to grails, for system scripting, the full
interpreter is really slow to start, and grails don’t have access to low
level API like symlinks or chmod things)…
About Java itself, it have the advantages to be the language to use to
extends many big softwares like Zimbra or Alfresco

What do you think about that ?
Thank you

egervari wrote in post #913624:

Anyway, our site has to support a lot of traffic, requires a lot of
cron-like stuff built into the application, and we’ll need to support
relational databases and something like cassandra.

Suggestions?

Here’s my one suggestion. Go try Rails for yourself. If you have
specific questions that you need help with then ask them here.

Asking abstract questions like these on a forum dedicated to Rails is
going to get you nowhere. It’s pointless really. All that will ever
happen is exactly what you see here. It starts a firestorm of defensive
responses and un-constructive conversation that just ends up wasting
everyone’s time.