Ruby/Rails: too good to be true?

I’ve never touched ruby/rails before, but after visiting ruby-lang.org a
couple of days ago my interest in Ruby has exploded. This is among other
things because of the beautiful syntax and the fact that everything is
objects.

FYI: I’ve been using PHP for 5-6 years now, and I’ve built my own small
company around this language - so when looking at Ruby and Rails I’m
naturally trying to compare them to PHP.

I’m the kind of person who finds it rather hard just to “trust” that
other people made a framework that is “perfect” my projects. This is not
because I think I’m better than other developers, but simply because I
know for sure that frameworks made by others simply isn’t made
especially for my project.

Therefore I have to ask: Why are so many people choosing Rails for their
web apps instead of making their own specific frameworks (as we see with
for example PHP). The percentage of websites based of PHP frameworks is
rather low - in ruby it seems that “all” websites are made with Rails (I
maybe wrong here, this is just my perception). Why is this?

In PHP you just add for example an apache server and you’re ready to
built your own web framework/projekt. Isn’t the same thing possible with
ruby??

Another concern I’ve got with Ruby/Rails is performance. I can see RoR
promises easy maintainability and beautiful code, but doesn’t this hurt
performance in the other end? And how is the scalability?

Now, enlighten me! :slight_smile:
Thanks in advance!

-Rasmus

Rasmus N. wrote:

I’ve never touched ruby/rails before, but after visiting ruby-lang.org a
couple of days ago my interest in Ruby has exploded. This is among other
things because of the beautiful syntax and the fact that everything is
objects.
FYI: I’ve been using PHP for 5-6 years now, and I’ve built my own small
company around this language - so when looking at Ruby and Rails I’m
naturally trying to compare them to PHP.

Ruby is a great language but coming from a scripting language you may
have a steep learning curve as I did. Once you get what object oriented
means and how embedded it is in Ruby, you will see how clean that can be
when applied to databases through an ORM.

I’m the kind of person who finds it rather hard just to “trust” that
other people made a framework that is “perfect” my projects. This is not
because I think I’m better than other developers, but simply because I
know for sure that frameworks made by others simply isn’t made
especially for my project.

Nothing is perfect. If you’ve got projects started, now is probably not
the time to switch them to a framework you do not fully understand.
Start a few small test projects to get a feel for the language and
framework. MVC is a decent way to abstract portions of code to ensure
consistency. Rails kicks this into high gear with REST and respond_to.

Therefore I have to ask: Why are so many people choosing Rails for their
web apps instead of making their own specific frameworks (as we see with
for example PHP). The percentage of websites based of PHP frameworks is
rather low - in ruby it seems that “all” websites are made with Rails (I
maybe wrong here, this is just my perception). Why is this?

Programmer happiness (assuming you can make it do what you want). The
curve is steep but the power at the top of the curve is immense.

In PHP you just add for example an apache server and you’re ready to
built your own web framework/projekt. Isn’t the same thing possible with
ruby??

It is and there are other frameworks. Camping is one.

Another concern I’ve got with Ruby/Rails is performance. I can see RoR
promises easy maintainability and beautiful code, but doesn’t this hurt
performance in the other end? And how is the scalability?

Why does crap code work faster? It doesn’t and you lose
maintainability.

Ruby itself has some slowness (at least in some benchmarks that I do not
fully understand) that is being worked on but clearly so many large
Rails web apps tells us that this Rails thing can scale. Isn’t that all
the proof you need?

OK, perhaps that’s not all you need. There’s caching that improves
performance. Many large sites use this. There’s also the ability to
ramp up many servers to run a site.

Now, enlighten me! :slight_smile:
Thanks in advance!

-Rasmus

On Dec 19, 2007, at 9:49 PM, Rasmus N. wrote:

company around this language - so when looking at Ruby and Rails I’m
their
web apps instead of making their own specific frameworks (as we see
with
for example PHP). The percentage of websites based of PHP frameworks
is
rather low - in ruby it seems that “all” websites are made with
Rails (I
maybe wrong here, this is just my perception). Why is this?

Mostly, I would not call those things real “Application Frameworks”.
This might not be the case,
with your projects, but in my experience most of those mini-frameworks
are in existance
because no one knew better. Sometimes, they are quite good, sometimes
they are horrible. Your
milage may vary.
I had the possibility to work both on “frameworkless” and framework-
based (Mojavi & Agavi) Sites
in PHP and I have to state: those based on a framework are easier to
handle. Consider a Framework
as a set of shared knowledge. We are all doing the same thing. So why
do it twice?
If you start thinking about the way a framework like Rails or Agavi
describe the web, you will
find out that most of your “problem orientated code” was useless -
because there is an easy,
general way of solving your problem.

In PHP you just add for example an apache server and you’re ready to
built your own web framework/projekt. Isn’t the same thing possible
with
ruby??

As PHP is build for web development (its default output stream sends
headers, etc.) , this is easier in
PHP. (using mod_php and the like…) Ruby by itself is not a web
language. It is a general purpose scripting
language like python or perl. Thus, doing specific low-level tasks is
sometimes a bit more work.
But the “web” problem is solved and there are more than one solutions
that you can just grab and
start using.

Another concern I’ve got with Ruby/Rails is performance. I can see RoR
promises easy maintainability and beautiful code, but doesn’t this
hurt
performance in the other end? And how is the scalability?

Performance is relative. For example, caching in Rails is really easy.
So your beautiful code that took you
10 minutes to write is taking 8ms longer in execution time than a low-
level unoptimized version.
You invest 2 more minutes and the page gets cached for 10 minutes and
will be served as if it was
a static page. So why optimize the code?

As every other stateless Framework, Rails scales - if you run out of
juice, throw another server at it. I don’t
know the size of your projects, but it takes a long time before you
hit a border.

On the other hand: yes, Rails solves many tasks and is thus big. So if
you like Ruby but some Rails facts hold you off,
there are other web frameworks in ruby that might be worth looking
into. Merb, Nitro, Ramaze, Sinatra, Camping,
just to name a few.

Now, enlighten me! :slight_smile:
Thanks in advance!

I hope I did - at least a bit ;).

-Rasmus

-Florian

After a short google-trip I found this wonderful website:
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=ruby&lang2=php

The benchmarks are not Ruby’s forte (although in Ruby 1.9 it’s supposed
to
be at least 2.5x quicker)

The sheer development speed of Ruby and the beauty of the language
(which
made your interest “explode”) is what makes programming Ruby/Rails fun
and
enjoyable and speeds up development time.

As for scalability, there’s nothing another Quad Xeon can’t fix :slight_smile:

On Dec 20, 2007 7:19 AM, Rasmus N.
[email protected]
wrote:

I’ve never touched ruby/rails before, but after visiting ruby-lang.org a
couple of days ago my interest in Ruby has exploded. This is among other
things because of the beautiful syntax and the fact that everything is
objects.

Another concern I’ve got with Ruby/Rails is performance. I can see RoR


Ryan B.

Florian G. wrote:

On Dec 19, 2007, at 9:49 PM, Rasmus N. wrote:

yes, ruby on rails is way to good to be true.
run, fast and far, and never look back.

by the way, who are your clients again?
i am trying to drum up some business.

i would not go as far as to say i am a pirate,
but, clients are clients, and money is money.
and… did i say i was a pirate?

FRED ROCKS. i nominate him for: RAILS YODA 2008

toodles.

On Dec 19, 6:23 pm, “Ryan B.” [email protected] wrote:

After a short google-trip I found this wonderful website:http://shootout.alioth.debian.org/gp4/benchmark.php?test=all〈=rub

The benchmarks are not Ruby’s forte (although in Ruby 1.9 it’s supposed to
be at least 2.5x quicker)

Also see

http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=yarv

Isaac G. wrote:

On Dec 19, 6:23 pm, “Ryan B.” [email protected] wrote:

After a short google-trip I found this wonderful website:http://shootout.alioth.debian.org/gp4/benchmark.php?test=all〈=rub

The benchmarks are not Ruby’s forte (although in Ruby 1.9 it’s supposed to
be at least 2.5x quicker)

Also see

http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=yarv

what it looks like it is saying… is that ruby is slower then php,
but ruby uses less memory. ruby 1.9 has improved in speed.

ruby is just fun, easy, and i have less problems looking at other
peoples code. i actually enjoy it.

Thank you for all your answers. It helped me a lot. Now I know what I’ll
be doing for the holidays - studying rails :wink:

Could you recommend any good resources on ruby/rails? Books or websites.

Thanks again.

Thank you for all your answers. It helped me a lot. Now I know what I’ll
be doing for the holidays - studying rails :wink:

Could you recommend any good resources on ruby/rails? Books or websites.

http://peepcode.com/

That should keep you busy for a little bit anyway. If you can learn
some
Ruby first. It will help with Rails.

On Dec 20, 2007 11:34 PM, Philip H. [email protected]
wrote:

Could you recommend any good resources on ruby/rails? Books or websites.

Jump Start Rails | SitePoint Premium
http://www.humblelittlerubybook.com/
http://railscasts.com/
http://peepcode.com/

That should keep you busy for a little bit anyway. If you can learn some
Ruby first. It will help with Rails.

And if your mind is suitably warped, you can learn some ruby and have
fun doing it from Why’s poignant guide.
http://poignantguide.net/ruby/

  • Martin