Ruby vs. PHP

Hello

My company is trying to get big contract for creating and maintaining HUGE website (nation wide portal). We're trying to convince investor that Ruby (i don't mean rails) with custom tailored MVC framework is best solution, we're going to make prototypes in rails FAST, then port heaviest and most frequently used parts to my custom framework, rewrite AR into tuned SQL queries etc.

investor was quite impresed with speed of development but of course there's trouble in paradise .. he hired a consultant :confused: - this guy AFAIK did lot's of work but only in PHP and he is trying to convince investor PHP is way to go.

could you please help me find some benchmarks comparing speed of PHP vs Ruby (especially YARV/JRuby, if ound some benchamrks that show Ruby is slower in interpreter), mayby comparsions of security(in Rails it's preatty imposible to do sql injections if programmer is carefull enought to use properly constructed queries).

also I'm open to any arguments(preferable documented, with showcases, and understandable by investor(who never had much expirience with computers except for e-mail and www)) that would help convince him that ruby is much better then php :slight_smile:

and I'm also looking for big sites that adopted ruby / ruby on rails (especially with huge number of users / hit's per s)

Marcin Raczkowski

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=ruby&lang2=php

···

On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

Hello

My company is trying to get big contract for creating and maintaining
HUGE website (nation wide portal). We're trying to convince investor
that Ruby (i don't mean rails) with custom tailored MVC framework is
best solution, we're going to make prototypes in rails FAST, then port
heaviest and most frequently used parts to my custom framework, rewrite
AR into tuned SQL queries etc.

investor was quite impresed with speed of development but of course
there's trouble in paradise .. he hired a consultant :confused: - this guy AFAIK
did lot's of work but only in PHP and he is trying to convince investor
PHP is way to go.

could you please help me find some benchmarks comparing speed of PHP vs
Ruby (especially YARV/JRuby, if ound some benchamrks that show Ruby is
slower in interpreter), mayby comparsions of security(in Rails it's
preatty imposible to do sql injections if programmer is carefull enought
to use properly constructed queries).

also I'm open to any arguments(preferable documented, with showcases,
and understandable by investor(who never had much expirience with
computers except for e-mail and www)) that would help convince him that
ruby is much better then php :slight_smile:

and I'm also looking for big sites that adopted ruby / ruby on rails
(especially with huge number of users / hit's per s)

Marcin Raczkowski

--

Yours,
Waleed Harbi
Nothing without reason everything for some thing.

Hello

My company is trying to get big contract for creating and maintaining
HUGE website (nation wide portal). We're trying to convince investor
that Ruby (i don't mean rails) with custom tailored MVC framework is
best solution, we're going to make prototypes in rails FAST, then port
heaviest and most frequently used parts to my custom framework, rewrite
AR into tuned SQL queries etc.

Why is this a good idea?

investor was quite impresed with speed of development but of course
there's trouble in paradise .. he hired a consultant :confused: - this guy AFAIK
did lot's of work but only in PHP and he is trying to convince investor
PHP is way to go.

PHP beats Rails in certain aspects; for instance if development of the
site is seasonal in nature, as opposed to continuous, the customer
is likely to be hiring as they need. The large availability of PHP
developers plays in its favour.

could you please help me find some benchmarks comparing speed of PHP vs
Ruby (especially YARV/JRuby, if ound some benchamrks that show Ruby is
slower in interpreter), mayby comparsions of security(in Rails it's
preatty imposible to do sql injections if programmer is carefull enought
to use properly constructed queries).

Well none of that is true, or really important. Sure its easier to secure Rails.
But if you are making a large nationwide portal (I am going to assume that
that means you have high activity) then the performance of your rendering
component (PHP or Rails) doesn't actually matter.

PHP isn't exactly assembler speed itself. Ruby is in the same league (slower
with 1.8, faster with YARV). There is a reason that PHP is a central component
in a LAMP stack - probably the solution of choice for websites with high user
load. In principle Ruby can do the same, in practice we have only had
about 2 years
as a community to get big Ruby sites up. You also have an equivalent ASP
stack based on windows components.

All of these stacks are glued together with languages that are at least an order
of magnitude slower than Systems languages like Java.

also I'm open to any arguments(preferable documented, with showcases,
and understandable by investor(who never had much expirience with
computers except for e-mail and www)) that would help convince him that
ruby is much better then php :slight_smile:

There's plenty of sites out there doing pretty heavy stuff with Rails,
but beyond
Rails there is not much evidence that shows pure Ruby custom web solutions
to scale. Rails has a lot of features and best practices built in to
help it scale.
In a pure Ruby solution you are committing to re-writing all of that
from scratch.

Based on your questions/responses here, I think the consultant is right; that
PHP is a better solution for the customer.

···

On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

I don't take responsibility for the quality of articles linked here -
but here's a blog post gathering links arguing right what you seem to be
looking for. Maybe it's worth checking out.

mortee

<snip>

I highly advise checking out the up and coming release of Merb for your
framework. You can hop on irc.freenode.net#merb and ask any questions you
have there about speed, features, etc...

Good luck.

  ~Wayne

···

On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

Hello

My company is trying to get big contract for creating and maintaining
HUGE website (nation wide portal). We're trying to convince investor
that Ruby (i don't mean rails) with custom tailored MVC framework is
best solution, we're going to make prototypes in rails FAST, then port
heaviest and most frequently used parts to my custom framework, rewrite
AR into tuned SQL queries etc.

I have an argument, altough a weird one at that. PHP is all about Apache deployment and mod_php. It's _optimized_ for the situation whereby you have many
applications running on the same site and many of these applications might be sloppy. Because of that, PHP dedicates a majority of it's potential to sustain a
shared-nothing architecture where the virtual machine gets reinitialized on every request etc. This is a total win for shared hosting and fast and dirty deployment on shareds,
but this strength is not applicable to high-volume deployment (on VPS or dedicated - which is I supposed is your deployment scenario for this scale).

In any _other_ area than deployment with maximum security of _developers_ from each and _raw speed_ PHP looses to Ruby. The following arguments are boilerplate that I usually put on the
table when the question 'Why Ruby arises':

a) the obscurity of the language gives much higher guarantees of library quality (both in implementation and style). All Ruby libs I came to use in the last few years have been remarkably elegant.
b) the fact that Ruby is currently on the edge of Agile interests (there are just more metodologies that get tested in Ruby-land as opposed to PHP)
c) any developer with a level of OOP experience can pick up Ruby remarkably easily (this does not apply to troglodyte bold types who want their "for" loop and don't give a damn about design)
d) most Ruby developers favor "clean" in place of "fast and dirty"
e) if you got the hardware the deployment is actually much more streamlined than for PHP projects (with tools like cap and vlad)
f) all C-aware developers that I know admitted that writing Ruby extensions in C is a breeze, if you need it
g) there is quite some development going on in the alternative interpreter scene (with projects like JRuby, Rubinius etc)

Basically there are two, and only two situations where I would either drop the project because it needs PHP or write it in PHP klinging:
a) you want ubiqutous deployment options - you want to distribute the script that the user can install on a shared hosting platform where he's even disallowed from doing a database dump
(not your case)
b) you need to bind to Win-only API's or deploy on Win

That's one of the best articles I know of on "slow versus fast" argument
http://plasmasturm.org/log/443/

···

On 1-okt-2007, at 12:51, Marcin Raczkowski wrote:

also I'm open to any arguments(preferable documented, with showcases, and understandable by investor(who never had much expirience with computers except for e-mail and www)) that would help convince him that ruby is much better then php :slight_smile:

--
Julian 'Julik' Tarkhanov
please send all personal mail to
me at julik.nl

There is a recent thread that covers speed. If you take ruby 1.9 and
compile it yourself, it runs about 5 or 6 times faster. That should
cover the speed aspect.

Also, the speed of the language is not necessarily all that critical as
long as it is more or less enough. You can always add hardware to cover
that aspect. After that it is the usefullness of the language that is
critical. There are always changes to be made. You really need a
language that can refactor and upgrade quickly and easily. So,
whichever language you can use to "git thar the firstest with the
mostest" (old saying) that is the one that they should use.

For the record, if your team is efficient and proficient with one
language and not the other, then go with what you know. Fighting a new
language could be a problem unless they can pick it up easily. Which
language is better is irrelevant if they cannot use it.

···

--
Posted via http://www.ruby-forum.com/.

This has been discussed a lot on this list, and I believe that a
majority of the community is concerning the shootout site a site
without any value.
For sure I do.

Cheers
Robert

···

On 10/1/07, Waleed Harbi <waleed.harbi@gmail.com> wrote:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=ruby&lang2=php

I wouldn't sweat it much.
Show them good sites built with these things. Explain the reasons you use what you use.
If they hire a consultant who only recommends one technology, then he's a shill.
He could just as easily be an ASP shill or a Java shill or anything else.
Ruby and Rails are still small compared to PHP, but booming and not shrinking.

You might want to show a bit more of the ongoing history of insecurity that is a lot more rampant with PHP sites, and even recommend a little security through obscurity. (that's what kept VAX systems going until HP end-of-lifed the OS)

But in the end, if you don't get it, chances are they'll go with a cheap and mediocre PHP shop. It's a lot like the cheap and mediocre Microsoft-based shops. There are lots of them, but there are lots of bad ones. Good PHP shops are probably more expensive (and busier) than you.

The truth is, the language used is only one small part of many things they should be carefully considering. Server (hardware/software) / web hosting can be as/more important. The language really shouldn't matter all that much. Google, Yahoo, etc... don't use strictly one language or framework in house! A decent programmer / team of programmers should be able to select the technology they feel will work best for them AND the project together. In some cases Ruby might be the wrong choice.

Everybody and their dog touts themselves as a nationwide high-traffic portal site to be, but if that were true or even likely, they wouldn't need a consultant, they'd have a CTO of some kind who would have already decided these issues. Sounds more like your selling lawn care services to a guy from the desert who has only heard of grass and is planning to build a golf course.

Richard Conroy wrote:

Hello

My company is trying to get big contract for creating and maintaining
HUGE website (nation wide portal). We're trying to convince investor
that Ruby (i don't mean rails) with custom tailored MVC framework is
best solution, we're going to make prototypes in rails FAST, then port
heaviest and most frequently used parts to my custom framework, rewrite
AR into tuned SQL queries etc.

Why is this a good idea?

why not?
rails is easy to prototype but is painfully slow and hard to optimize, i know caching is going to play huge role but optimized complex sql queries are also important

investor was quite impresed with speed of development but of course
there's trouble in paradise .. he hired a consultant :confused: - this guy AFAIK
did lot's of work but only in PHP and he is trying to convince investor
PHP is way to go.

PHP beats Rails in certain aspects; for instance if development of the
site is seasonal in nature, as opposed to continuous, the customer
is likely to be hiring as they need. The large availability of PHP
developers plays in its favour.

possibility of continous development is one of strong points of rails, and that's why i'm advertising it, code writen by that large group of php developers is usually unmaintainable. I had plenty of expirience with php and i know how strangely can be php written, and rails forces good practices like MVC, and ruby i much cleaner langue then php to begin wth

could you please help me find some benchmarks comparing speed of PHP vs
Ruby (especially YARV/JRuby, if ound some benchamrks that show Ruby is
slower in interpreter), mayby comparsions of security(in Rails it's
preatty imposible to do sql injections if programmer is carefull enought
to use properly constructed queries).

Well none of that is true, or really important. Sure its easier to secure Rails.
But if you are making a large nationwide portal (I am going to assume that
that means you have high activity) then the performance of your rendering
component (PHP or Rails) doesn't actually matter.

if it's easier to screw up in PHP with security, then here it's REALLY important, try to imagine hacker group logo in something like msn/yahoo main page

PHP isn't exactly assembler speed itself. Ruby is in the same league (slower
with 1.8, faster with YARV). There is a reason that PHP is a central component
in a LAMP stack - probably the solution of choice for websites with high user
load. In principle Ruby can do the same, in practice we have only had
about 2 years
as a community to get big Ruby sites up. You also have an equivalent ASP
stack based on windows components.

what is the reason? php was never solution of choice for high-load or professional websites, it was promoted becouse suposed ease of use and installation

All of these stacks are glued together with languages that are at least an order
of magnitude slower than Systems languages like Java.

also I'm open to any arguments(preferable documented, with showcases,
and understandable by investor(who never had much expirience with
computers except for e-mail and www)) that would help convince him that
ruby is much better then php :slight_smile:

There's plenty of sites out there doing pretty heavy stuff with Rails,
but beyond
Rails there is not much evidence that shows pure Ruby custom web solutions
to scale. Rails has a lot of features and best practices built in to
help it scale.
In a pure Ruby solution you are committing to re-writing all of that
from scratch.

any examples? i know google is starting to use Ruby.

thanks for your response, it rises valid point that i have to think over

···

On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

mortee wrote:

I don't take responsibility for the quality of articles linked here -
but here's a blog post gathering links arguing right what you seem to be
looking for. Maybe it's worth checking out.

http://rubythis.blogspot.com/2006/12/justify-your-choice-of-ruby-on-rails.html

mortee

thanks that's exactly what i was looking for.

Wayne E. Seguin wrote:

···

On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

Hello

My company is trying to get big contract for creating and maintaining
HUGE website (nation wide portal). We're trying to convince investor
that Ruby (i don't mean rails) with custom tailored MVC framework is
best solution, we're going to make prototypes in rails FAST, then port
heaviest and most frequently used parts to my custom framework, rewrite
AR into tuned SQL queries etc.

<snip>

I highly advise checking out the up and coming release of Merb for your
framework. You can hop on irc.freenode.net#merb and ask any questions you
have there about speed, features, etc...

Good luck.

  ~Wayne

Thanks i was talking with Ezra Zygmuntowich on irc a while ago, and i borrowed lots of ideas (and some of code) for my own microframework.

If there were any interesting changes in merb I'll take a look, but my framework was designed to do exactly what i needed (which was to handle AJAX and forward to remote servers, then parse request and send to application when next AJAX request hits) and did job right :slight_smile:

Robert Dober wrote:

···

On 10/1/07, Waleed Harbi <waleed.harbi@gmail.com> wrote:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=ruby&lang2=php

This has been discussed a lot on this list, and I believe that a
majority of the community is concerning the shootout site a site
without any value.
For sure I do.

Cheers
Robert

i found this one, and also it's interprete ruby not YARV or JRbuy

Finally a topic I like :slight_smile:

rails forces good practices like MVC

I believe this is debatable. What we should not forget
is that, while this uniform maintenance is a good
thing in general, rails also forces you into its world of
thinking.

The truth is, the language used is only one small part of many
things they should be carefully considering. [...]
The language really shouldn't matter all that much.

I will take another approach and claim that the language
used is and will be the biggest most influencing factor.
It is exactly the reason why PHP became popular today -
it beat Perl cgi scripts. It was easier to learn than perl.
It had a good online docu. It concentrated on the web +
database aspects.
Every language has different pros and cons, and there may be
some cases where php really has more advantages than ruby.
But in general ruby as a language is simply better than php.
That includes the world wide web, but unfortunately there
are a little problems. Rails for example, forces you to
think in the rails-way, for the good or for the bad.
(By the way, it would be cool to be able to
embed ruby straight into a .php document... right now
I am porting my legacy .php scripts to ruby, it takes
quite long :stuck_out_tongue: )

also I'm open to any arguments(preferable documented, with showcases,
and understandable by investor(who never had much expirience with
computers except for e-mail and www)) that would help convince him that
ruby is much better then php :slight_smile:

Easiest way to convince is code examples. Focus on simple tasks that
have some reallife usage value to him (the investor). But of course
the comparison must be fair, so dont make it too complex :wink:

It would actually be nice to have a way to compare PURE php (+solutions)
with PURE ruby (+solutions for web-tasks:

  * Post data into a "web formular" in both languages
  * retrieve data from a mysql database
  * run automated "comparisons" and other data manipulations
    from a "web formular" (i.e. something for your investor
    that makes working with it easy)

Personally, I am a bit unhappy that PHP is compared to Rails so
often ... PHP should be compared to Ruby, and then if we can,
Ruby should improve on the area where PHP has a slight edge.

To me, speed was NEVER a reason, and to be honest, I think
some people really overrate the speed issue at first hand.
At least it should be untied from OTHER reasons, such as
the online docu part for example, where I think PHP still
has a lead over ruby in that aspect. :wink:

···

--
Posted via http://www.ruby-forum.com/\.

John Joyce wrote:

I wouldn't sweat it much.
Show them good sites built with these things. Explain the reasons you use what you use.
If they hire a consultant who only recommends one technology, then he's a shill.
He could just as easily be an ASP shill or a Java shill or anything else.
Ruby and Rails are still small compared to PHP, but booming and not shrinking.

You might want to show a bit more of the ongoing history of insecurity that is a lot more rampant with PHP sites, and even recommend a little security through obscurity. (that's what kept VAX systems going until HP end-of-lifed the OS)

But in the end, if you don't get it, chances are they'll go with a cheap and mediocre PHP shop. It's a lot like the cheap and mediocre Microsoft-based shops. There are lots of them, but there are lots of bad ones. Good PHP shops are probably more expensive (and busier) than you.

One of main reasons why my (small and new) company is considered is becouse productivity using rails is so high that even if i want much more money per hour of work then php professional i finish same thing properly secured with rails before php developer finishes collecting his tools and code snippets

The truth is, the language used is only one small part of many things they should be carefully considering. Server (hardware/software) / web hosting can be as/more important. The language really shouldn't matter all that much. Google, Yahoo, etc... don't use strictly one language or framework in house! A decent programmer / team of programmers should be able to select the technology they feel will work best for them AND the project together. In some cases Ruby might be the wrong choice.

I feel ruby especially thanks to JRuby (possibility to use java libraries), ruby:inline(possiblity to use c/c++) and IronRuby(same for c#) might be best choice to tie all together, and i can use rails to make it all work in record time

Everybody and their dog touts themselves as a nationwide high-traffic portal site to be, but if that were true or even likely, they wouldn't need a consultant, they'd have a CTO of some kind who would have already decided these issues. Sounds more like your selling lawn care services to a guy from the desert who has only heard of grass and is planning to build a golf course.

well, mayby i described size wrongly, first of my country is much much smaller then US :], money are diffirent, and stage of IT also.

CTO's usually depend on consultants anyway, but this one agrees that ruby is good choice and need a little push, so I'm asking you all to provide me with arguments i can use in php vs. ruby battle :wink:

I know pros and cons, and I personally prefer ruby (i have solid background in php, never liked it, had horrible 4 months while i tried to maintain code written by php "programmers", which was full of sql injection holes) so I "know" i want to write in ruby / ruby on rails, and think it's right decision to use this technology.

Richard Conroy wrote:
> Why is this a good idea?

why not?
rails is easy to prototype but is painfully slow and hard to optimize,

Well thats a claim you will have to back up. I don't see it as being
harder than any other optimization work.

i know caching is going to play huge role but optimized complex sql
queries are also important

And Rails/AR etc. support multiple levels of caching, and you can always
do find_by_sql. ActiveRecord dynamic finders are fun and all, but have no
place in a production app.

possibility of continous development is one of strong points of rails,
and that's why i'm advertising it, code writen by that large group of
php developers is usually unmaintainable. I had plenty of expirience
with php and i know how strangely can be php written, and rails forces
good practices like MVC, and ruby i much cleaner langue then php to
begin wth

Fair enough. Win for Rails.

if it's easier to screw up in PHP with security, then here it's REALLY
important, try to imagine hacker group logo in something like msn/yahoo
main page

Agreed. But the default security in Rails is not bulletproof. Its also not
difficult to replace or improve. Edge Rails is bringing in protection for
Cross Site Request Forgery.

PHP security is probably going to remain a gaping wound for some time to
come. Win for Rails.

>
> PHP isn't exactly assembler speed itself. Ruby is in the same league (slower
> with 1.8, faster with YARV). There is a reason that PHP is a central component
> in a LAMP stack - probably the solution of choice for websites with high user
> load. In principle Ruby can do the same, in practice we have only had
> about 2 years
> as a community to get big Ruby sites up. You also have an equivalent ASP
> stack based on windows components.

what is the reason? php was never solution of choice for high-load or
professional websites,

Ah no. PHP is provably in use in many of the largest sites on the internet, like
Wikipedia, Facebook etc.. The foundations of why a basic language like
PHP works in this
environment is easy to understand: PHP doesn't give you many sharp tools
to hurt yourself with so its runtime characteristics are very predictable.

ASP stacks work the same way.

Rails is imitating those stacks. So it should reap the same rewards,
but the biggest
Rails website (twitter I think) is currently not in the same league as
the biggest PHP
and ASP sites.

Win to PHP. But not for much longer I suspect.

> There's plenty of sites out there doing pretty heavy stuff with Rails,
> but beyond
> Rails there is not much evidence that shows pure Ruby custom web solutions
> to scale. Rails has a lot of features and best practices built in to
> help it scale.
> In a pure Ruby solution you are committing to re-writing all of that
> from scratch.

any examples? i know google is starting to use Ruby.

Well no not really. The last really good writeup on the internal workings
of google, came from Steve Yegge a couple of months ago (see his
blog on Rhino on Rails).

Ruby is not yet one of the Google sanctioned languages (C++, Java, Python
& JavaScript).

thanks for your response, it rises valid point that i have to think over

I am not being hypercritical of your choices. In your situation, I would go
with Rails over PHP as well, for much of the same reasons (performs
well enough, rapid delivery, long term maintenance).

But you have committed to an ActiveRecord rewrite, and your reasoning
is not clear. It sounds like you have read something that 'ActiveRecord
doesn't scale' without investigating thoroughly.

Rails gets a lot of its productivity from ActiveRecord. By getting rid of it,
you lose that, and you also close the door on the community development
of ActiveRecord and its supporting plugins.

···

On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

Richard Conroy wrote:
>>Hello
>>
>>My company is trying to get big contract for creating and maintaining
>>HUGE website (nation wide portal). We're trying to convince investor
>>that Ruby (i don't mean rails) with custom tailored MVC framework is
>>best solution, we're going to make prototypes in rails FAST, then port
>>heaviest and most frequently used parts to my custom framework, rewrite
>>AR into tuned SQL queries etc.
>
>Why is this a good idea?

why not?
rails is easy to prototype but is painfully slow and hard to optimize, i
know caching is going to play huge role but optimized complex sql
queries are also important

My first thought was that it's a good idea because PHP is more painful to
use than Ruby and sometimes I have needs other than those for which Rails
is best suited.

>
>>investor was quite impresed with speed of development but of course
>>there's trouble in paradise .. he hired a consultant :confused: - this guy AFAIK
>>did lot's of work but only in PHP and he is trying to convince investor
>>PHP is way to go.
>
>PHP beats Rails in certain aspects; for instance if development of the
>site is seasonal in nature, as opposed to continuous, the customer
>is likely to be hiring as they need. The large availability of PHP
>developers plays in its favour.

PHP doesn't beat Rails at all, because "PHP" is not the same category of
tool as Rail. PHP may be Ruby in some respects, and Smarty may beat
Rails in some respects, but saying PHP beats Rails is like saying wood as
a boat-building material beats a given shipyard (which happens to make
all its ships out of steel).

>
>All of these stacks are glued together with languages that are at least an
>order
>of magnitude slower than Systems languages like Java.

Java isn't what I'd call a "systems language". That'd be something like
C instead. Java tends to be better than languages like PHP for
long-running webserver processes because of the optimizing VM, but that
doesn't make it a "systems language".

>
>>also I'm open to any arguments(preferable documented, with showcases,
>>and understandable by investor(who never had much expirience with
>>computers except for e-mail and www)) that would help convince him that
>>ruby is much better then php :slight_smile:
>
>There's plenty of sites out there doing pretty heavy stuff with Rails,
>but beyond
>Rails there is not much evidence that shows pure Ruby custom web solutions
>to scale. Rails has a lot of features and best practices built in to
>help it scale.
>In a pure Ruby solution you are committing to re-writing all of that
>from scratch.

any examples? i know google is starting to use Ruby.

News to me. Last I checked, Steve Yegge actually ported Rails to Rhino
(JavaScript) because he wanted to use Rails but Google wouldn't adopt
Ruby (they have a strict policy about what languages their developers are
allowed to use at Google, as far as I'm aware).

···

On Tue, Oct 02, 2007 at 12:59:36AM +0900, Marcin Raczkowski wrote:

>On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
W. Somerset Maugham: "The ability to quote is a serviceable substitute for
wit."

I'm jumping in late here, and I've only skimmed most of the replies,
so pardon me if I'm repeating anything already said:

Richard Conroy wrote:
>> Hello
>>
>> My company is trying to get big contract for creating and maintaining
>> HUGE website (nation wide portal). We're trying to convince investor
>> that Ruby (i don't mean rails) with custom tailored MVC framework is
>> best solution, we're going to make prototypes in rails FAST, then port
>> heaviest and most frequently used parts to my custom framework, rewrite
>> AR into tuned SQL queries etc.
>
> Why is this a good idea?

why not?
rails is easy to prototype but is painfully slow and hard to optimize, i
  know caching is going to play huge role but optimized complex sql
queries are also important

On the other hand, there are lots of folks working on optimizing
Rails, how many are working on optimizing your custom tailored
framework.

If you don't want to use Rails, then why not look at something which
already has somewhat of a community like merb?

>
>> investor was quite impresed with speed of development but of course
>> there's trouble in paradise .. he hired a consultant :confused: - this guy AFAIK
>> did lot's of work but only in PHP and he is trying to convince investor
>> PHP is way to go.
>
> PHP beats Rails in certain aspects; for instance if development of the
> site is seasonal in nature, as opposed to continuous, the customer
> is likely to be hiring as they need. The large availability of PHP
> developers plays in its favour.
>

possibility of continous development is one of strong points of rails,
and that's why i'm advertising it, code writen by that large group of
php developers is usually unmaintainable. I had plenty of expirience
with php and i know how strangely can be php written, and rails forces
good practices like MVC, and ruby i much cleaner langue then php to
begin wth

Here I totally agree with you. In fact, I'd argue that Rails is a
better choice for a "seasonally" developed project than the average
PHP application.

Nicely written PHP code can be picked up quickly by a new developer,
but from what I've seen except for some large open-source php efforts
like mediawiki, there's a lot of not so nice PHP code out there. I've
tried a couple of times to take on maintenance of PHP apps and have
always had to turn down the gig.

On the other hand, Rails apps tend to be easy to pick up even "second
hand." Most follow the convention over configuration philosophy, so
they all tend to have similar structure. And the good ones tend to
have nice test suites which make it easier for the new guy to grok
what it's supposed to do.

So even though the population of Rails savvy programmers might be
smaller than the PHP community, there's a much higher probability that
any of then could pick up and existing Rails app than a random PHP
programmer could understand a random PHP application.

On the other hand, how many will understand your custom MVC framework?

Of course if you're looking for job security AFTER you get the gig....

···

On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

> On 10/1/07, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Robert Dober wrote:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=ruby&lang2=php

This has been discussed a lot on this list, and I believe that a
majority of the community is concerning the shootout site a site
without any value.
For sure I do.

Cheers
Robert

I guess that depends on how you define "value" and "majority". As a practicing performance engineer, here's my view on the subject:

1. The site is very clear about what it is doing, how it is doing it, why it is doing it and to a great extent how one can (not) and should (not) interpret the results. However, anyone is free to misinterpret any of that out of either ignorance or competitive marketing zeal.

2. If you actually look at the benchmark timings for the three main Ruby implementations tested, jRuby, Ruby 1.8.6 and Ruby 1.9.x, you'll find that they give roughly the same comparative speeds on these benchmarks as they do on the virtual machine benchmarks bundled into the Ruby 1.9.x code. In fact, I think some of them are in both sets. This is a good sign.

3. Given 2, one can be (and I am) encouraged to go farther and use the site to compare implementations of other languages with implementations of Ruby. I have not done a recent comprehensive analysis, but if the raw data can be downloaded in a form suitable for it, I'll take a stab at it.

4. I suspect the main problem the "majority of the community" has with the site is that it shows that the current (MRI) Ruby 1.8.6 implementation is slower than other languages commonly used to implement web applications. And that is mostly competitive marketing zeal. Of course the Ruby community wants Ruby to be faster than Perl, Python, PHP or Java. And when it turns out that it isn't faster, there are two things that can be done:

(a) Argue about how much more productive Ruby is, saying that you can throw hardware at the scaling problem with the dollars you save
on programmers, and/or

(b) Make faster implementations of Ruby.

Neither of these options is "right" or "wrong" IMHO. For (a), I claim that the economics of programmer productivity and the economics of web application deployment and scaling are in fact two very different studies. You can get degrees in either and earn a comfortable living doing either. I've spent more time on the second because I think it's more fun. :slight_smile:

For (b), I think the results of Ruby 1.9.x (KRI) and jRuby speak for themselves, and at some point in the not-too-distant future we should have some IronRuby and Rubinius numbers as well. And perhaps the Parrot effort will change the playing field for Perl, Python, PHP *and* Ruby in one bold beak-stroke! :slight_smile:

···

On 10/1/07, Waleed Harbi <waleed.harbi@gmail.com> wrote:

Easiest way to convince is code examples. Focus on simple tasks that
have some reallife usage value to him (the investor). But of course
the comparison must be fair, so dont make it too complex :wink:

It would actually be nice to have a way to compare PURE php (+solutions)
with PURE ruby (+solutions for web-tasks:

  * Post data into a "web formular" in both languages
  * retrieve data from a mysql database
  * run automated "comparisons" and other data manipulations
    from a "web formular" (i.e. something for your investor
    that makes working with it easy)

since i have background in php i can provide investor with code samples, but I know that ruby is better for me, problem is to convince investor that know nothing about programming

Personally, I am a bit unhappy that PHP is compared to Rails so
often ... PHP should be compared to Ruby, and then if we can,
Ruby should improve on the area where PHP has a slight edge.

that's why I'm asking about advantages of ruby (read my post carefully) and in second order rails - if I'm talking about rails i should compare it to cakePHP or Smarty or something like that

To me, speed was NEVER a reason, and to be honest, I think
some people really overrate the speed issue at first hand.
At least it should be untied from OTHER reasons, such as
the online docu part for example, where I think PHP still
has a lead over ruby in that aspect. :wink:

Problem with online docu is that there's TONS of shity, ugly, exploitable code online for php and noone cares - i even saw statistics saying that 80% of php code have serious sql-injection vulnerabilities.

as for speed - it doesn't matter if something is 2-3 times slower then same thing in J2EE, it doesn't even matter if it's 10 times slower, but if one request to rails takes 5 seconds on modern server it DOES matter :wink: