Ruby VS PHP

I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

Now, I am new to Ruby and programming in general, and
wasn't really able to offer any insightful reasons why
he should at least look at Ruby. So, I was wondering
if I could get some ammo for next time, especially
from people with a PHP background.

I don't mean the title in a literal sense, I'm more
after some general points about Ruby which distinguish
it from PHP.

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Any comments with regards to this? Point me in the
right direction if its been brought up a million times...:slight_smile:

···

___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

Tristan Knowles ha scritto:

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Any comments with regards to this? Point me in the
right direction if its been brought up a million times...:slight_smile:

I can comment this last sentence. If he thought php (and <5 !) was OO he has a bad idea of what Object Oriented means.
Anyway show him the usual rails videos :wink:

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Lol, that's pretty funny. It may have had a few OO type
implementations, but they were hacked and incomplete. PHP4 OO was
also incomplete and felt very hackish to me. (I can't say anything
about v5, because I haven't used it ... because I have Ruby/Rails now
;).

Basically, PHP started out as a small personal project (like many
languages) and has evolved over time. Features were added as needed,
but the core remained relatively unchanged for quite some time, and
they simply built around it. Ruby, on the other hand, was built from
the ground up with OO in mind.

I agree - if you can, show him the rails video. Ask him if he could
get a working blog app up in 15 minutes[1]. I have to admit, I didn't
see the Rails light until I saw Curts tutorial, but I've been hooked
ever since.

Tristan Knowles wrote:

I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

Maybe in his hands it can.

Now, I am new to Ruby and programming in general, and
wasn't really able to offer any insightful reasons why
he should at least look at Ruby. So, I was wondering
if I could get some ammo for next time, especially
from people with a PHP background.

Suggest that Ruby might offer a different take on OO and dynamic typing than PHP, and that he might gain some insight on programming in general by taking a look at other languages. If there is a lack of natural curiosity then screw it.

I don't mean the title in a literal sense, I'm more
after some general points about Ruby which distinguish
it from PHP.

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Ah, "But that's not OO!"

See Rees Re: OO

  James

···

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

And why do you continue to talk to him? It's a waste of time.

···

On 2005-07-16 17:03:07, Tristan Knowles wrote:

I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

I have used PHP over the last three years to build a fairly complex, high
traffic and quite profitable web-based CRM-like application in the education
market. It served me well in the early stages of the business because we
were able to get new features out very rapidly and scaling for traffic has
been no problem. But I have to say I think the biggest weakness is in
scaling with the complexity of your application. That's why I'm on this
mailing list right now. I'm looking at Ruby and specifically RoR as a way to
maintain the agility that comes from using a dynamic language but gain some
structure and a greater power to manage an increasingly complex domain
model. The PHP community has been pushing toward more "best practices" like
test-driven development, design patterns, etc., but this is a relatively
recent thing and while PHP allows you to do these things, it doesn't
necessarily make them easy or natural. You can do a lot of things with PHP
or any language if you're smart enough, but that doesn't mean you should if
there are other tools for the job that are more productive. Getting more
productivity out of my development team is a much bigger business issue for
me right now than scaling to handle more traffic. It all depends on what
your ultimate goal is. I'm a Ruby Nuby so don't take my word for it, but so
far I'm pretty excited by what I've found both in terms of the language
itself and the community behind it, relative to my experience with PHP.

···

On 7/16/05 11:03 AM, "Tristan Knowles" <cydonia_1@yahoo.com> wrote:

I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

Now, I am new to Ruby and programming in general, and
wasn't really able to offer any insightful reasons why
he should at least look at Ruby. So, I was wondering
if I could get some ammo for next time, especially
from people with a PHP background.

I don't mean the title in a literal sense, I'm more
after some general points about Ruby which distinguish
it from PHP.

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Any comments with regards to this? Point me in the
right direction if its been brought up a million times...:slight_smile:

___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail
http://uk.messenger.yahoo.com

I assume PHP is turing-complete, no? =)

···

On 7/16/05, Tristan Knowles <cydonia_1@yahoo.com> wrote:

I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

--
I tend to view "truly flexible" by another term: "Make everything
equally hard". -- DHH

Hmm. I havn't even seen these... Gonna check them out.

···

--- Belorion <belorion@gmail.com> wrote:

I agree - if you can, show him the rails video. Ask
him if he could
get a working blog app up in 15 minutes[1]. I have
to admit, I didn't
see the Rails light until I saw Curts tutorial, but
I've been hooked
ever since.

___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

Hello Belorion,

I dropped the whole OO vs not true OO but he claimed
PHP has been OO since v3.

Lol, that's pretty funny. It may have had a few OO type
implementations, but they were hacked and incomplete. PHP4 OO was
also incomplete and felt very hackish to me. (I can't say anything
about v5, because I haven't used it ... because I have Ruby/Rails now
;).

PHP 5 is much much better. They only have the same problem that
disqualifies PHP for more complicated things: All source code must be
loaded and parsed all the time on each request.

Because of the PHP include/require mechanism and programming style only
some of this parsing tasks can be cached by 3rd party add-ons to the PHP VM.

Basically, PHP started out as a small personal project (like many
languages) and has evolved over time. Features were added as needed,
but the core remained relatively unchanged for quite some time, and
they simply built around it. Ruby, on the other hand, was built from
the ground up with OO in mind.

But it was with build with web sites in mind.

And it is still the best tool out there for simple websites that
only need a little scripts. For these millions of websites rails would
be completely unusable because of costs for
introduction/resources/maintainance.

The main PHP problem is just that too many people thought (and even
still think) it scales well with increased application size.

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

if it never frees memory that seems a bit like reading a finite length tape
doesn't it? so maybe no. :wink:

-a

···

On Mon, 18 Jul 2005, Michael Campbell wrote:

On 7/16/05, Tristan Knowles <cydonia_1@yahoo.com> wrote:

I was chatting with a PHP dev friend tonight, he is a
PHP die hard who thinks it can do anything.

I assume PHP is turing-complete, no? =)

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
My religion is very simple. My religion is kindness.
--Tenzin Gyatso

===============================================================================

--- Lothar Scholz <mailinglists@scriptolutions.com>
wrote:

And it is still the best tool out there for simple
websites that
only need a little scripts. For these millions of
websites rails would
be completely unusable because of costs for
introduction/resources/maintainance.

The main PHP problem is just that too many people
thought (and even
still think) it scales well with increased
application size.

Actually, part of my reason for learning Ruby is
because I have a project coming up that I will be
designing, and i'm not sure if PHP is up to the task.
I have been looking at ColdFusion, or more likely, the
J2EE framework.

I prefer the philosophy and community of Ruby, but am
still not sure at which point it is required. When
would you say, ok, here is a job for Ruby?

A basic site requiring a MySQL backend for a few
queries here and there is obviously a job for PHP, so
at what stage is Ruby required?

···

___________________________________________________________
How much free photo storage do you get? Store your holiday
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

The main PHP problem is just that too many people thought (and even
still think) it scales well with increased application size.

Another one is that their team changes a lot of stuff a lot of times and
just sometimes put some compatibility to older versions.
The database functions changed but the old ones works. The way to refer
to $this changed somewhere on the 5.x development and they just leaved
the things breaks. :frowning:

- ----------------------------
Eustáquio "TaQ" Rangel
eustaquiorangel@yahoo.com

Usuário GNU/Linux no. 224050

Scalability has a lot more to do with design than language. I work at a
company with an extremely large PHP codebase pushing over 5200 requests
a second at peak.

Though I prefer the coding style Ruby encourages myself, PHP is like
Perl - it's only as good as the programmer writing it. My main problem
with it has always been somewhat lackadaisical regression testing on new
releases. That may have improved in 5.x as well, but they had a bad
habit of introducing stupid bugs in the 4.x series.

···

On Sun, 2005-07-17 at 01:42 +0900, Lothar Scholz wrote:

The main PHP problem is just that too many people thought (and even
still think) it scales well with increased application size.

--
Matthew Berg <galt@gothpoodle.com>

Actually PHP does scale well, see flickr.com as an example. There is a
nice presentation [1] which deals with the architecture of flickr and
the technical problems which occured when they got more popular.

[1]: http://www.niallkennedy.com/blog/archives/2004/10/flickr_architec.html

Best regards,
Jochen

···

On 07/16/2005 06:42 PM, Lothar Scholz wrote:

The main PHP problem is just that too many people thought (and even
still think) it scales well with increased application size.

According to the PHP manual:

  Resource management is a crucial issue, especially in server software.
  One of the most valuable resources is memory, and memory management
  should be handled with extreme care. Memory management has been
  partially abstracted in Zend, and you should stick to this abstraction
  for obvious reasons: Due to the abstraction, Zend gets full control
  over all memory allocations. Zend is able to determine whether a block
  is in use, automatically freeing unused blocks and blocks with lost
  references, and thus prevent memory leaks.

···

On Mon, 2005-07-18 at 01:00 +0900, Ara.T.Howard wrote:

On Mon, 18 Jul 2005, Michael Campbell wrote:

> On 7/16/05, Tristan Knowles <cydonia_1@yahoo.com> wrote:
>> I was chatting with a PHP dev friend tonight, he is a
>> PHP die hard who thinks it can do anything.
>
> I assume PHP is turing-complete, no? =)

if it never frees memory that seems a bit like reading a finite length tape
doesn't it? so maybe no. :wink:

--
Matthew Berg <galt@gothpoodle.com>

I still think that PHP 4/5 have uses, especially in small sites or in
one-post type applications. Even though Ruby / Rails seem the most efficient
languages to me even for middle sized projects, PHP has the ability to
quickly let you implement a template system, or to do a quick form that in
Ruby dragging out CGI would seem too much.

So, from my personal perspective, and what direction our company is taking,
Ruby (and/or) Rails for medium and large projects, and PHP for small ones.

···

On 7/16/05, "Eustáquio Rangel de Oliveira Jr." <eustaquiorangel@yahoo.com> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> The main PHP problem is just that too many people thought (and even
> still think) it scales well with increased application size.

--

Robert W. Oliver II
CEO / President - OCS Solutions, Inc.

Actually, part of my reason for learning Ruby is because I have a project coming up that I will be designing, and i'm not sure if PHP is up to the task. I have been looking at ColdFusion, or more likely, the J2EE framework.

I prefer the philosophy and community of Ruby, but am still not sure at which point it is required. When would you say, ok, here is a job for Ruby?

I like Ruby because I find it easier to maintain than PHP or Perl.

A basic site requiring a MySQL backend for a few queries here and there is obviously a job for PHP, so at what stage is Ruby required?

I think 43 things is the largest RoR site by traffic, and this week we did 3,109,986 requests, averaging 444284 requests per day. (Requests through Rails. Hits for the site has been hovering just under the 2 million mark per day, the remaining 3/4 being images and so-forth.)

This is with 2 dual-xeon web servers and a dual-xeon DB server. We have very complex pages, and we're just past half our processor capacity on the web servers (I think, its hard to judge). The DB server has lots of room for growth.

To get back to the maintainable part...

We launched the site in 4 months with 5 developers, 4 of them had zero Ruby experience. About 6 months later we launched a new site. We're about to start working on a 3rd with an even shorter cycle. We didn't work on the new site for all of those 6 months, maybe 2 of them, and we borrowed (and overlayed) much of the code for the new site from the old.

We didn't plan to extend the original 43 things into 43 places, but Ruby let it happen without much difficulty.

···

On 16 Jul 2005, at 09:50, Tristan Knowles wrote:

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

* Robert Oliver <rwoliver2@gmail.com> [2005-07-17 02:25:24 +0900]:

I still think that PHP 4/5 have uses, especially in small sites or in
one-post type applications. Even though Ruby / Rails seem the most efficient
languages to me even for middle sized projects, PHP has the ability to
quickly let you implement a template system, or to do a quick form that in
Ruby dragging out CGI would seem too much.

So, from my personal perspective, and what direction our company is taking,
Ruby (and/or) Rails for medium and large projects, and PHP for small ones.

Are you aware that you can now use Wee inside rails. So, those
simple one-post type applications become even more trivial.

···

--
Jim Freeze

Jim,

No I wasn't aware of using Wee for simple things. I'll check this out.

Still.. we gotta find something for PHP to do don't we? :slight_smile:

···

On 7/16/05, Jim Freeze <jim@freeze.org> wrote:

* Robert Oliver <rwoliver2@gmail.com> [2005-07-17 02:25:24 +0900]:

> So, from my personal perspective, and what direction our company is
taking,
> Ruby (and/or) Rails for medium and large projects, and PHP for small
ones.

Are you aware that you can now use Wee inside rails. So, those
simple one-post type applications become even more trivial.

--
Jim Freeze

--

Robert W. Oliver II
CEO / President - OCS Solutions, Inc.

Also, you could note that with Ruby you can make non-Web applications, which to my knowledge, you can't with PHP.

···

--
Este correo esta libre de virus!